Slowly, and with logic rather than luck.
Every number tells you exactly how many mines touch that square, which means most positions can be reasoned out: some squares are provably safe to reveal, others provably contain a mine. Work from the certainties and you rarely need to guess. The Strategy and Hints section of the in-game help is worth reading for the recurring patterns.
You win by uncovering every square that isn't a mine — nothing more, nothing less.