Migraine and headache

How do i distinguish between both and also any permanent medication to this