Gender-separated spaces are common in many parts of the world, and knowing the etiquette saves embarrassment. On transport, several countries run women-only metro or train carriages, marked by signs or platform colours, sometimes only during rush hours.
Religious spaces segregate more often than transport does. Mosques typically have separate prayer halls or entrances for women, some temples restrict certain inner areas by gender, and Orthodox Jewish sites like the Western Wall have divided sections. Follow the signage, use the correct entrance, and dress to the stricter standard: covered shoulders and legs, head covering where required.
Spas and bathhouses vary widely: some are fully segregated, some mixed with swimwear, some nude within single-gender areas, and rules differ by country and even by facility. Read the posted rules or ask staff before undressing anything. When in doubt anywhere, hang back for a moment and copy what locals of your gender do.