Head ache and poor memory

I am 24 weeks. I have a continuous headache, paracetamol doesn't help much. I take medicine as a last resort. I am drinking alot of water aswell. But the headache is the same.

Beside today very randomly I feel weird, like I don't remember names of people and suddenly I felt I could not speak or explain myself. As of my brain has stopped thinking.

It made me panic and stressed out as to whats happening to me.

I still can't express how I am feeling. I'm hoping this is temporary, but it's worrying me. It's like my brain has stopped working and thinking. What shall I do? It's stressing me out.