The following can help prevent cluster headaches:  Avoiding headache triggers. Certain medications. Melatonin.