Hello.
First of all let me allay your biggest anxiety - you are not losing your memory. Dementia of the old age doesn't occur at your age.
This is classically forgetfulness from being preoccupied. When one is extremely anxious, under slept or depressed, they show memory lapses often. These are typically for day to day things.
A good night sleep is essential for the memory circuits to re wife and memory to stay intact.
I recommend you handle the problems by targeting the headache and sleep first and rest will fall into place.
Next Steps
See a qualified psychiatrist
Health Tips
Follow sleep hygiene