They should only be used for these things. Follow the instructions carefully and do not take more than the recommended dose. If you take too many, or go on taking them for long periods, they can damage your stomach, kidneys and the ability of the blood to clot properly. Aspirin and paracetamol are the commonest analgesics. Additional pain-relieving combinations can be obtained from a pharmacist.
Some stronger analgesics require a doctor's prescription.
Analgesics are good for relieving some pains. They do not cure what is causing the pain - they simply stop it bothering you so much. They will not however, prevent you from getting a headache later in the day, or stimulate you when you feel short of energy, or calm you down when you feel upset. You should never take analgesics for any of these reasons. They will not help - and by taking them too often you risk damaging your health.