When people don't know each other in the gym, it is inevitable that there will be contact with strangers, but girls are often at a disadvantage in such contact, and some sexual harassment will inevitably occur in the process. I think there are several ways to avoid these troubles as much as possible:
I think we can start by planting girls themselves. I think some girls really wear cool clothes in the gym. In order to highlight their better figure, or to exercise more easily, they wear very little, because they sweat very hot, but this will often attract more strangers to chat up and even attract more sexual harassment. In fact, many girls dress relatively sexy in order to attract more attention of the opposite sex, so the possibility of sexual harassment has also increased. So I don't think girls should wear too little, T-shirts or clever sports bras in the gym. I think it's ok, and don't dress too sexy.
Secondly, I think we can invite our partners, either of the same sex or the opposite sex. Of course, the opposite sex is better. We can invite our partners to the gym. If there are many people, the other party will not be too crazy. Try not to stay alone in a sparsely populated place, or walk away when the other party strikes up a conversation. Don't give each other a chance to speak. If he insists on physical contact, he can ask the people around him for help and shout loudly.
Also, I think we can choose a gym with relatively good environmental quality. Such gyms often have relatively good management and security capabilities. If there is sexual harassment, we can ask the security guard or the counter staff for help in time.