An interesting thing about remembering what you learned is that you’re more likely to remember something in the place where you learned it.
If you took your history exam in a lecture-style classroom with big windows, you may recall what you learned best in that same or a very similar classroom.
Obviously, you can’t stage your bedroom with desks and a lectern, but you can make a similar environment by regulating temperature, smells, and noises.
If you’re going to take a test at a desk, study at a desk, not in bed.
If the classroom is warm or cool, study at home in a warm or cool room. Wear the same soothing fragrance during the recital that you wore during piano practice.
The closer you make the test or performance environment to the practice environment, the better you’ll remember what you learned.