You will be fine. I promise, any pain you feel will fade with time.
You need to see this man for what he actually was, and for what he did.
The absolute best thing you can do is to block him on every platform, delete all his details from your phone so you can't contact him again even if you're drunk and it seems like a good idea, and permanently erase everything even remotely to connected with him. Photos, videos, ALL messages, emails, love letters, gifts, Spotify playlists - everything. Stop going to places that remind you of him, if possible.
Make an alternative, upbeat, "f*ck you" playlist. Surround yourself with friends, and get busy making plans that excite you.
Make a mental list of all the reasons he's not good enough. Everything wrong with him. All the times he moaned about his wife, to whom he vowed to be faithful forever. His gross habits, crap communication skills, sh*te tattoos, whatever. I'm sure if you're really honest with yourself, you can imagine an alternative timeline in which he left his wife to be with you. And I'm sure you know that it would have ended badly - likely with you, brokenhearted, angry at having wasted years of your life with him. If he pops into your mind, this is what you focus on. All the reasons you had a lucky escape. The opportunity you have now to go out and find someone bloody brilliant who would never dream of cheating on anyone.
Lastly, use this as a life lesson, so you are never tempted to do this again. Nobody wins in these scenarios.