Mountain bike tire pressure that is too high will make for poor contact with the ground and a less controllable ride, while mountain bike tire pressure that is too low will make your tires behave unpredictably and will make them susceptible to pinch flats.
The real trick is to find out exactly what mountain bike tire pressure works best for you and your setup under normal conditions. You can then learn to adjust this pressure for different trails and terrain as needed.
Here's the best way I have found to get to the right pressure for your setup:
Find a good reliable pressure gauge or a pump with a pressure gauge. Use this same gauge or pump the whole time you are making adjustments. Gauges are notoriously inaccurate so if you switch around it will make things much more difficult.
Start with a higher pressure somewhere around 40-50 psi (3-3.5 bar)for for 2.2-2.3 inch tires. For tubeless systems, start much lower, 30 to 40 psi. The heavier you are or the smaller your tires, the higher pressure you should start with. Ride with this pressure for a while and get a feel for how the tires hook up in corners and on loose dirt.
Now, drop the pressure by 5 psi (0.35 bar) in each tire. Once again get a feel for how this new setup rides and compare it to the previous setting. You should feel some improvement in tire hookup with the ground and a little more stability. If you don't notice any difference drop the pressure by another 5 psi (0.35 bar).
What you want to find is the lowest pressure you can ride without sacrificing pinch flat resistance. You get a pinch flat when your tire rolls over an object and compresses to the point where the tire and tube literally get pinched between the object and the rim of the wheel. This commonly results in a snake bite or double puncture in the tube.
Continue to reduce tire pressure by 3-5 psi (0.1-0.3 bar) until you feel the tires are hooking up well. If you go too far, you will start getting pinch flats, so stop dropping pressure in your tires as soon as you feel you have good control or you no longer notice any improvement between pressure drops.
If you start feeling your rims contact objects or if you start getting pinch flats, raise the pressure back up in small intervals.
In tubeless systems, since you don't have to worry about pinch flats so much, you can run much lower pressures and some occasional rim contact is OK, but if you start denting your rims, burping air out along the bead, or if you feel the tire roll under the rim during hard cornering, you have gone too low.
There is another balance you play with tire pressure. Lower pressure does increase rolling resistance. However, some argue, the increased control and climbing traction makes up for the extra effort needed to compensate for the extra rolling resistance. I lean toward running nearly as low pressure as you can get away with. Cross country racers may decide to sacrifice a little control for a little better efficiency.
Once you find a comfortable tire pressure setting, learn what your tire feels like when you squeeze it with your hand. When you know what your tires should feel like you can always get the right pressure, with any pump.