It's not really normal to sleep badly and have memory gaps like that, so you're right to look for solutions. I found out the problem was mostly coming from how I studied - I'd try to cram everything the night before, which just stressed me out even more and made sleep impossible. I changed my approach by starting my revisions way earlier and leaving some actual free days before exams, and honestly it makes such a difference. Also check what you're doing before bed: stop using screens an hour before, try some basic breathing exercises if you're too in your head about it, and if exercise helps you (like someone else mentioned here), go for it - it's scientifically proven and I also notice I sleep way better after a good workout.