No quick and easy
Keep a diary of when you get your headaches, how much sleep
you get, how much stress
you are under, when your periods are (if you are a woman), and even what you eat and drink.
This can help you find clues to the causes of migraines. Generally having a healthy lifestyle helps prevent headaches - eating healthy food, getting enough sleep, managing stress well. See your doctor for more help.