Every number says how many mines touch that square, counting all eight neighbours. Open every square that is not a mine and the board is swept. Flags are only a note to yourself: the game is won by opening the safe squares, not by flagging the mines.
The first square you open is always safe, and so is everything touching it, so a board opens into an area you can read rather than a guess.
Click to open, right click to flag. Tab and Enter work through the board, X flags the square with focus, G turns flag mode on, N is a new board, M mutes, F is fullscreen.
Tap to open, hold a moment to flag. Flag mode turns every tap into a flag, which is easier when there are a lot of them to place.