Is a male permitted to go to a segregated beach when it is not officially in use in that some people may pass by what should he do, must he close his eyes or leave the beach for shmirat einyaim when people inappropriate dressed passed by?
If a person is in a place where it is permitted to be–for example, a segregated beach, where immodesty is not expected–and he is confronted by an immodest sight, then he should strive to look away, and ensure that he doesn’t see.
Sources: See Bava Basra 57, where the Gemara discusses the question of “immodest sights.” The assumption of the Gemara is that one who goes to a place where he will be seeing immodest sights, even though he has another option, is “wicked,” and doens’t enter the Talmudic discussion. Rather, the discussion concerns a person who has not other way to walk, and therefore it is permitted for him to walk on a path even though he will be confronted by immodest sights. Such a person is praised for “closing his eyes,” meaning that his behavior is considered particularly righteous. See Shulchan Aruch, Even Ha’ezer 21; Iggros Moshe, Even Ha-Ezer I, no. 56.