If you go to the beach knowing it is likely there will be scantily dressed women there, and you are tempted to lust by them, it is a near occasion of sin. You needn’t supply your own immodest women.
Here’s a better example. If you’re going about your normal activities, go into a store to purchase necessary items, and there’s a possibility of encountering an immodestly dressed woman, that is a remote occasion of sin. It could also be a near occasion if it’s summer, but it is necessary for you to purchase items, however, you are still permitted in the store without sinning. The store is generally not a place known for the presence of immodest women, however, the beach is such a place.