The way I learned the few openings I now know is basically :
- Playing them a lot.
- In the (soon few) games where your natural play gives you a crappy position out of the opening, go ask theory™ where you screwed up.
Learning lines as you make mistakes in them helps a lot for remembering them, since you have to confront what you thought to be correct to what actually is.
I think the most important part of “learning openings”, far from being memory, is getting comfortable with the positions that are most likely to arise, and to know where you're going (i.e. have a plan to fall back onto when you're out of your book).
Eventually, you'll learn about the tricks and traps that lie around as you fall into them, or your opponent overplays and you fail to punish. But most importantly, you'll learn the positions you get to play often first.
Last but not least : always play the same openings you're trying to learn, and don't learn many at once (for obvious memory overflow reasons).
Note that I don't hold a very high opinion of opening theory, and tend to advise most people to care a lot less about it, and rather improve their actual thinking and play. If you get a decent enough position out of your opening, then the fun begins (and that's where it incredibly helps to understand what theory got you into, what you're playing for, and what you should keep an eye on, etc.)