How not to forget things we learned?
I'll suggest a couple of things here.

First, and most important, if this is a new thing for you, or if it has developed recently then find a doctor. Go to a specialist in Neurology. You may need to get a brain scan. This is especially important if you are young, but also worthwhile if you aren't. There are some degenerative brain diseases that you want to know about early on. 

The other, totally unrelated, is that if you are under a lot of stress, say in your work, then your brain, even if completely "normal" might not be working efficiently and your immediate concerns might be interfering with recall of things in long term memory. There are a lot of things that I know, and I know that I know them and haven't forgotten them, but it takes me a lot of effort to recall them. I try to lead a stress free life but the modern world makes that difficult. 

Stress can be a killer, actually. If this is your issue you need to find ways to reduce it to a manageable level. One way is to do regular physical activity. Evan better is to do some physical activity that also engages your brain in a way different from your work or normal life. The physical activity gets your blood flowing and oxygenated, and the change in brain activity also can reduce stress. Some university departments field, say, softball teams. Many universities have athletic facilities open to faculty and all students. 



I've assumed here that this is not an issue of not being able to recall things you've learned thoroughly. If that isn't the case and you are still a bit shaky on the knowledge, as students normally are, then it is more a question of reinforcing your knowledge through practice and engagement with the material. That is a different issue altogether, of course. 

Someone, a regular writer here, made and deleted a comment that you depend less on memory and keep important things in notebooks. I agree somewhat with that, especially in the sense that creating notebooks is, itself, a reinforcement of what you know and want to remember. Perhaps that writer will come back and fill out an answer. 

Also note that, as my doctor explained to me, forgetting and lack of recall are not the same problem, though they seem to be.