Couples therapy and establishing boundaries. For example, I would not text that female coworker one on one anymore. If you have to communicate outside of work then you might think of making a group chat with other co workers or be up front with your wife and showing her the messages from your coworker and your reply back.

If your wife thinks you're waking up in the middle of the night to text your coworker then make an effort to show her you're not. Leave your phone on your bedside or wherever you keep and make a point (but don't throw it in your wife's face) to show you don't have your phone with you. 

You like the attention from the co worker because it's new and exciting and you're getting something you're not from your wife at home. You're wife probably can sense this which is where the jealousy comes from and your actions aren't helping. So I would suggest talking to one another and setting new boundaries for how you interact with your coworker and making an effort to show your wife nothing more is going on and that you love and care about your wife. Since you've had issues in the past couples therapy would probably be helpful to deal with past betrayals and avoiding a future one.