How do you get rid of thoughts of being with someone?

Every now and then I think about being with someone but I don’t want that. Especially, if I’m not in a good place mentally. Any suggestions would be great.
How do you get rid of thoughts of being with someone?
Post Opinion