What do I do?😩💔

At work my friend had went on vacation and while he was on vacation we started talking just as friends and we were sharing how we both have anxiety and we feel like outsiders in the world and we just kept talking about that stuff and then one day the conversation started getting sexual and we both started developing feeling for each other then he came back from vacation and everything was different it was like we were boyfriend girlfriend but the thing is he has a wife and kids. This relationship went on for a few months and feeling got stronger and we did eventually end up having sex and a week later we ended things. I know we had to end it and we shouldn’t even been talking or being in a relationship because he is married but when we ended it I felt heart broken and I don’t know how to be around him at work and we text almost everyday and I don’t know if we should stop doing that. Some day I’m ok and some day I really miss him. I just don’t know how to get over him.