It will be a difficult journey but you will get through it. You gotta have self control, willpower, and self respect. And finally give yourself some leeway. It's not gonna happen over night. You gotta give yourself time.
First of all . . I am very flattered, but I am happily married now for 28 years . . .
Seriously though, if you are in the same circle of friends this will be impossible . . . You have to remove yourself situations that allow yourself to fantasize about having a relationship . . . As Yin and Yang says this will take TIME.
Find something to keep to keep yourself busy. Find activities that you won't see the person. If you are out doing something you enjoy doing, you will often find someone who has the same interest and is more capatible.