You need to sit down and try to figure out why you are dating or wanting to date other people even though you are married. Ask yourself if you are truly not happy with your spouse, or if you are simply going through a mid-life crisis, with the latter being an extremely common occurrence in marriages that have lasted for a fair bit of time. You may be getting interested in other people because your spouse is not giving you enough attention, or you feel emotionally disconnect from them.
After you have figured out the reason or reasons for cheating or wanting to cheat on your spouse, get down to resolving these issues straight away. You cannot simply ignore the factors that are putting your marriage under threat and making you do what is unacceptable after marriage, dating other people.
Make yourself understand that under no circumstances is it okay to continue dating after marriage, unless of course your spouse is your date. Do not start justifying your act. When you get married to someone, you are supposed to stay loyal and sincere to your partner. You have a moral obligation of living up to their trust. If your marriage is not how you expected it to be, or if you no longer love your spouse and feel that marriage counselling or any amount of effort cannot possibly make you love them again, then it is best to get a divorce instead of start cheating on them.
Stop cheating on your spouse. Avoid people that tempt you to step out of the boundaries of marriage. Also try to stay away from situations that may cause you to cheat. Do not hang around with members of the opposite sex, especially someone who is interested in you and hits on you despite knowing that you are already married.
Talk to your partner. Ask them for help. If they really love you, they would do whatever they can to help you cope with your current feelings. They will help you to refrain yourself from giving in to your forbidden desire.