Go through these in order and stop at the first one that applies. If you are reading this for someone else, answer for them.
1
Is any of this happening now?
Call 911
Call emergency services if you have thoughts, plans, or an immediate intention to harm yourself or someone else, or if dangerous behaviour during sleep cannot be safely controlled.
Severe confusion, agitation, or hallucinations while awake after stopping alcohol or another substance also requires emergency help.
Other emergency signs, for anyone
Someone who is struggling to breathe, gasping, choking, or cannot get words out
Someone who has chest pain, tightness or pressure lasting more than a few minutes
Someone who has sudden weakness or drooping on one side of the face or body, slurred speech, or sudden confusion
Someone who is unconscious, or cannot be woken
Someone who is bleeding heavily and it will not stop with firm pressure
Someone who has had a seizure that will not stop, or does not wake up afterwards
Someone who has lips or skin that look pale, blue, grey or blotchy
Someone who you believe has taken an overdose or swallowed something poisonous
2
Is any of this happening?
Be seen today
Seek same-day medical care if you have injured yourself or someone else while acting out a dream, or if repeated dream enactment creates an immediate risk of injury.
3
Does any of this apply?
Book an appointment
Book a routine appointment if nightmares:
Continue for several weeks or happen regularly
Make you afraid to sleep or cause ongoing sleep loss
Affect your mood, concentration, work, school, or relationships
Began after a new medicine or dose change
Followed a traumatic event and remain distressing
Occur with loud snoring, gasping, marked daytime sleepiness, or unusual movements
The article also says
Dream enactment without an injury is not usually an emergency, but it still deserves prompt assessment.
Until then, reduce nearby hazards and avoid sleeping close to sharp, heavy, or breakable objects.
Every sign above is quoted from the sofidex article on Nightmares. If you are not sure, err upward — it is always reasonable to be checked.