If you know you can't be with them, then it's best to forget about the person. If you keep thinking about them and holding them up as the "ultimate standard", then you'll always feel as though nobody else compares to them. Instead, it's better to try to find the flaws with that person. Then look for appealing characteristics in other people you meet so you can move on.
“This planet has - or rather had - a problem, which was this: most of the people living on it were unhappy for pretty much of the time. Many solutions were suggested for this problem, but most of these were largely concerned with the movement of small green pieces of paper, which was odd because on the whole it wasn't the small green pieces of paper that were unhappy.” ― Douglas Adams, The Hitchhiker's Guide to the Galaxy