There are certain guidelines that may help one achieve this.
For instance:
1.Understand that "No" means no.
2.Never abuse or exploit a position of power.
3.Be sensitive to the vulnerabilities of the people around you.
4. Behave in ways appropriate to the place in which you find yourself: i.e.: behaviour that would be acceptable in a sex club is unlikely to be acceptable in the office or the back of a taxi.
5. Avoid the kind of banter that demeans people of the opposite sex or people whose sexuality differs from your own.
6. Have some regard to your personal dignity. There's a reason why elderly lechers are universally regarded with contempt.
This doesn't exhaust the list- but all the rules you can think of pretty much boil down to "treat people (including yourself) with respect."
The unredacted list of Tory sex-pests is now widely available. I've seen it. There are 40 names on it- with brief accounts of what they are supposed to have done. Not all of them- however- appear to have fallen foul of the above guidelines. Having an office affair with someone of your own pay grade isn't abuse. Neither is indulging in non-mainstream activities with consenting adults (either fellow enthusiasts or people who have been paid for their services). That still leaves a large group of honourable members whose behaviour- to use the term employed in self-exculpation by one of them- has been "old-fashioned". They should be disciplined, told not to do it again or else- and the worst offenders should be given their marching orders. In one or two instances the Law should get involved.
We now need similar lists to be produced for the other parties.