The first step would be to realize that fantasizing about extramarital sex is not equivalent to an actual sexual affair with someone. The next step would be to discuss honestly the problems the two of you are having. Doing that with professional facilitation may be a good option. While the Internet is a wonderful tool it has it's down-side like everything else and porn sites are one of them. Unplug the computer and get rid of it! Then seek counseling. If your mate rejects this idea then it's time to move on.