Practise is the most important part.
You can just build cool stuff, if that gives you the right amount challenge.
If you find that building 'real' stuff has too many simple parts, or if you want to learn specific things, you can also solve small puzzles.
I've used Hackerrank before and it's quite entertaining. (As a bonus, some companies use it as tests during interviews).
EDIT It also helps to reflect on your approach after solving a problem or being stuck for a while. What did you do? Did it work? Which theories do you have about the cause? How can you test them? What's the most useful information to obtain? How can your IDE help?