I first learned morse code (CW) when I got my novice in the late 1970s. At that time, the requirement was 5WPM. So, I learned at that speed - BIG MISTAKE. By learning the code at such a slow speed, your brain goes through the mental translation of the dits and dahs to the memorized pattern for each letter. This process is slow, and will ultimately limit your operating speed. What's worse is, it is hard to UN-LEARN this process.
So, if you are starting from scratch, you can use practice tapes, or various code programs (I used G4FON Koch Method Morse Trainer) to help you. Use a fast character speed - at least 20wpm character speed, but at a longer spacing between characters. This will help your brain to recognize the "sound" of each character, not the individual dits and dahs.
It takes practice, even just a little every day. 20-30 minutes each day is a good place to start.
This is just my opinion. Everyone learns differently, but this is what works for me.