Poor sleep affects memory immediately and. Anyone who has tried to hold a conversation after a bad night knows this without being told.
The longer-term relationship between sleep and dementia risk is genuinely complicated, and worth being careful about.
some sleep problems are treatable and worth pursuing for their own sake.
Also worth reading: sleep's role in memory protection.
If those do not help within a few weeks, that is a reason to see a doctor rather than to keep trying harder. Insomnia has effective treatments, and cognitive behavioural therapy for insomnia outperforms sleeping tablets over the long run.