How do people do this?

so i am single but got out of a relationship back in August. a lot of times i’ll here a girl or guy say they aren’t interested in dating or have too much going on. not to me just in general. For me though it feels i’m always on a search for a girlfriend. does anyone have tips on how to turn off the search? like too myself i seem very desperate for someone in my life and i don’t like needing anyone unless they’re family. I want to put all focus on getting better in every aspect of life. but all that’s on my mind is oh she’s really pretty and worst part is most of the girls work with me. Technically it’s not a bad thing but it doesn’t sound right in my head.
How do people do this?
Post Opinion