Loperamide works by slowing the gut so stools become firmer and less frequent. It can be useful for adults needing short-term symptom control, for example during travel or work. Use it strictly as directed on the packaging and do not exceed the stated amount, as misuse can cause serious heart problems.
Avoid anti-diarrhoeal medicines and seek medical advice instead if you have blood or mucus in the stool, a high temperature, or suspected bacterial dysentery, because slowing the gut can trap the infection. They are generally not recommended for young children, who should be managed with rehydration and a doctor's input.
If diarrhoea is severe, persistent beyond a few days, or accompanied by dehydration or severe pain, do not just keep taking medicine; get assessed. A pharmacist can confirm whether an anti-diarrhoeal is appropriate for your situation.