Some beautiful advice from knowledgeable people of our past. InshA'Allah these or some of them might be helpful:
Cure for headache Caesar of Rome once sent a letter to Amīr-ul-Mūminīn Sayyīdunā ‘Umar Fārūq A’ẓam
In his letter, he mentioned, ‘I have chronic headache; if you have any medicine for this, please send it to me.’
Amīr-ul-Mūminīn Sayyīdunā ‘Umar Fārūq A’ẓam sent him a cloth cap. Whenever Caesar of Rome wore that cap his headache would be relieved, and whenever he removed the cap, his headache would reoccur. Amazed, he eventually unstitched the cap and found a piece of paper on which was written (in the name of Allah The Most Gracious, The Most Merciful) ﷽
(Asrār-ul-Fātiḥaĥ, pp. 163; Tafsīr Kabīr, vol. 1, pp. 155)
Once Sayyidunā Mūsā got extremely severe stomach pain. He humbly asked Allah for relief and Allah ordered him to consume so-and-so herb from a jungle. Therefore, Sayyidunā Mūsā consumed the herb and was immediately cured of the pain.
After some days, the same disease reoccurred so he consumed the same herb again. Contrary to his expectation, his pain became even more severe. He humbly asked the Almighty, ‘O Allah ! What is the secret behind this? One medicine has two entirely different effects! When I consumed it first time, it cured me but when I consumed it second time, it intensified my pain!’ Allah said, ‘O Mūsā! You used the herb that time with My command but you used it this time of your own accord. O Mūsā! Cure is in My name. Without My name everything of the world is a deadly poison and My name is its cure.’
Beginning an act with the name of the Most Gracious will inshA'Allah prove effective
Recite this verse 3 times, with Ṣalāt-‘Alan-Nabī once before and after it, and make Dam (i.e. blow) on the person who has a headache. He will feel relief inshA'Allah,
Surah Al Waqiah Verse 19
They will have niether headache nor any unconsciousness.
لَّا يُصَدَّعُوۡنَ عَنۡهَا وَلَا يُنۡزِفُوۡنَۙ