DO NOT tilt your head back if you have a nosebleed. Blood is swallowed or it enters the airways. Better sit up straight and bend your head slightly forward. This relieves the pressure in the head. Breathe in and out evenly through your nose. This promotes blood clotting.
If too much blood comes out of the nose, pinch the lower part of the nostrils together with your thumb and forefinger and breathe calmly through your mouth. Cotton wool or a handkerchief in the nose is not recommended, because removing it often leads to renewed bleeding. It is helpful to cool your neck, because this constricts the blood vessels and reduces the blood flow.
If blood gets in your mouth, just spit it out. If the bleeding doesn't stop after 10 to 20 minutes, you should consult a doctor.