Go through these in order and stop at the first one that applies. If you are reading this for someone else, answer for them.
Seek emergency help for severe or rapidly worsening abdominal pain, repeated vomiting, a hard or markedly swollen abdomen, fainting, chest pain, or trouble breathing.
Heavy rectal bleeding or feeling faint with bleeding is an emergency.
An inability to pass stool or gas with severe pain and swelling also needs urgent assessment.
Get same-day medical advice if flatus occurs with persistent vomiting, fever, black or bloody stool, or significant abdominal pain.
Book a routine appointment if the change lasts several weeks, keeps returning, wakes you from sleep, or affects daily life.
Also seek assessment for unexplained weight loss, ongoing diarrhea or constipation, reduced appetite, or a lasting change in bowel habits.
Every sign above is quoted from the sofidex article on Flatus. If you are not sure, err upward — it is always reasonable to be checked.