Hi there,
There could be a number of reasons for your headache and inability to focus and remember, which could be inter-related
1. You're not interested in what you're studying.
2. You have a refractive error, get your eyes checked from an ophthalmologist.
3. There could emotional/psychological reasons for which you need seek professional help.
4. A neurological cause like migraine also needs to be ruled out.
Next Steps
Consult with an ophthalmologist, and psychiatrist/neurologist if required.