Sleeping with someone after breakup

My boyfriend of 3 years and I broke up around 2 months ago. About a month ago I slept with someone else whom I don’t talk to anymore. We technically weren’t dating but I still feel really bad. I lost my virginity to my ex and we were together for a long time. Part of me just wanted the validation that I’m able to find someone else and that others may want me. Also he was only the second person I slept with. Anyways, my ex and I still talk because we co own a dog now lol, and the idea of getting back together and missing each other has come up. I feel like I need to tell him, but I feel as if he won’t want to get back together anymore. This makes me so upset. I’m not one to sleep around and I shouldn’t have slept with that guy but I did and can’t take it back. I truly love my ex and he still loves me and it will break his heart. Looking for advice! 😔