What I've noticed to be very helpful has been to focus on studying as much as possible. To get rid of distractions by turning off IM programs, the web browser(unless you're studying from the web), your phone, telling people no to disturb you and so on. In general, to get rid of distractions - yes, even music! Do not even attempt multitasking, because you can't achieve it without degrading mental performance. It is very expensive to switch back and forth between different subjects in your mind, you'll lose track of what you learned, you feel you get nowhere and in the end you just end up wasting time. So again, get rid of distractions, focus on one thing at a time!
To go beyond just getting rid of distractons, taking notes is very helpful too. For example, when you read about subject X, have a physical notebook open and a pen available and write down notes. Document what you learn. Drawing mind maps might sound bit of a stretch, but really, they help too! They help you to visualize the things you learn and how the concepts relate.
Another important thing I've noted, as others have mentioned, has been to apply what you've learned. For example after reading a chapter from a programming book, doing the quizzes/programming probles is very valuable in giving experience and really stretching you to actually do something concrete with what you've learned. Remember, actual proficiency on any field is 1 % theory and 99 % practice. ;)
That's not all to it. Actually having consistent sleeping pattern and daily schedule is crucial. Not only does sleep deprivation make it hard to focus on things at hand, cause memory lapses or loss or - there's also evidence suggesting sleep deprivation decreases bran activity which obviously is not good when you want to learn and remember. There's also evidence suggesting that afternoon nap increases learning capacity. I've personally witnessed that lack of sleep degrades my motivation to a level at which I don't even bother learning anything at all. Based on that, I'd also argue that sleeping is also crucial for keeping positive motivation towards learning new things.
The last but not the least... "I hear and I forget; I see and I remember; I do and I understand.", A Chinese Proverb.