What should I do for frequent nightmares?

If the nightmares are psychosomatic, for example, if you are depressed or have experienced a major event, you may need to take antidepressants and undergo regular psychotherapy, which may reduce the nightmares.
If the nightmares are caused by physical illnesses, such as obstructive sleep apnoea syndrome, Parkinson’s disease, cerebral haemorrhage, cerebral infarction, etc., you should first actively treat the physical illnesses and as you recover from the physical illnesses, combined with appropriate psychological treatment, the nightmares may improve significantly.
Also adopt some good habits conducive to sleep, such as avoiding stimulating foods and doing some relaxation before going to bed, so that nightmares may stay away from us.