How do u get over someone who has a girlfriend?

His relationship with his girlfriend is 8 years. I’m still attracted to him. I flirt with him sometimes but i dont think its ”wrong” as long as we dont do anything sexual.
How do u get over someone who has a girlfriend?
Post Opinion