If you shift-click or right-click on a square, you can turn it red, marking it as having a mine. Some people may find it helpful to have another color, for instance, to mark squares that might be mines. You can choose whether to have a third color (yellow) or to just have two colors. If you choose to allow yellow squares, shift-clicking a red square turns it yellow, and shift-clicking it again turns it back to gray; otherwise, shift-clicking a red square turns it directly to gray.
The game treats a yellow square the same as a gray square for the purpose of determining how many mines are left, how many mines are around a square (when uncovering a group of squares), etc.