This is a slightly edited response I recently wrote to someone who asked how to learn skills that would be useful at a hackathon. It's my usual response when someone asks how to get started programming.
You should start by approaching the problem from a different perspective. You should be thinking "I want to build X. Now what do I need to learn to build that?" not "I want to learn to build stuff. What can I learn?"