When you brake, use both brakes together. Generally speaking, when conditions are good, the front brake accounts for as much as 2/3 of the bike's stopping power. How much brake pressure to use depends on your abilities, you bike's capabilities, and the environment.
If you lock up your rear wheel, you must ride it out until you stop. If you release the brake while you're skidding, you will fly over the bike (high-side) when the tire grabs traction again.