"Exposure" is the word a friend uses. And no, not physical exposure! But being in a setting in which people are around each other casually for an extended period of time. You get to notice little things about people over time, and some people become more attractive, others less so.
The other way is numbers. If you say hello to a number of women, eventually something might result from it, but there are no guarantees. But that is why obnoxious men get more dates - they try with more women. They may get no response 100 times but on the 101st time they get a date. It may not be a quality date but it's a date. So it depends upon what you want. I only say this about the obnoxious men because some men envy them or wonder why women date them at all. Well, some women never get talked to either.
The problem with talking to or asking out a stranger is that you have no idea what they are like or if you will like them.
The internet is another way I guess, but it can be the best or worst of both other ways.
If you do approach a stranger, be as natural as you can. Say hello, remark about something obvious in the room, ask them how they are. Keep it simple. If they are interested they will say something back. If it keeps going, ask for their number or give them yours. Of course this may change by circumstance but those are basics. FYI I am female and married. (This is from a female perspective)