I just made a comment on a similar issue in the following thread: “Meditation Techniques”
My comments there are fully applicable to your situation as well.
– Instead of angry thoughts discussed there, yours are lustful thoughts.
– So, instead of metta Bhavana being suitable for that case, it is asubha Bhavana that would apply here. That means contemplating the bad (long-term) consequences of engaging in sensual activities.
Of course, if one is married, one does not need to abstain from sex. There were many Sotapannas who lived moral family lives during the time of the Buddha. Vishaka and Anāthapiṇḍika were the two foremost lay disciples of the Buddha who lived family lives. Both were Sotapannas.
– If one wants to avoid any sexual activities and work toward the Anagami stage, the issue of how to deal with the family situation must be addressed first.