A convinent source of information about this is going to be Simon Tatham's excellent puzzle suite. Most the puzzles are built to ensure a solution without guessing.
You can’t have enclosed areas that contain mines, there’s probably a few others.
The easiest thing to do is to write a solver which will iteratively mark squares it knows to contain a mine, or knows don’t contain a mine. If the solver can find all the mines the board is solvable. Only present the user with boards that your solver can solve.
Not parent: if you click a square and it says 7/6 then sometimes (next to a corner) you can only guess, you can't deduce the correct square to flag. There are others.