How do I stop waking up with a migraine??

What am I doing wrong is it the pillow , air quality, what ???! Most of my migraines I get is sometimes as soon as I wake up . Please help me guys …