Learning programming is easy but learning it from scratch isn’t.
This is a step by step process which you should learn. Start from here:
1) Acquire and read a book about basic computer science(I recommend picking up and reading just one book at first, then getting on to actual coding. You’ll never become a successful programmer if all you do is read textbooks). You do, however, need to understand what the computer is doing on a basic level, and how code turns into useful stuff happening on-screen. You also need to understand the difference between int, byte, float, double, long, boolean, etc, why they exist in that form, and why you would use one type over another. Then you need to know what Object-Oriented Programming is, and what advantages it has over earlier programming methods. Hop on Amazon and search for something with good reviews.
2) Basic understanding down, choose what you want to do, what interests you, and select a language that is common for that type of work. There isn’t necessarily a right or wrong here, but it’s important to choose one language and stick with it until you are competent with that language, and then branch out into new ones. Bouncing around a whole bunch of languages early on will have you confused as shit, and EVERYONE has an opinion about what languages are good or bad. Pick one, and stick with it. If I had to pick one for you to start with, I’d recommend Python, but as I mentioned, everyone has an opinion, and you should do some research about the pros and cons before selecting. Don’t fret too much, though. And don’t switch languages every time somebody tells you “x language is bad, you should be learning y instead”. Also, learn what an IDE is and use one. They’re enormously helpful.
3) Tutorials. Practice. Someone I can’t recommend strongly enough is Derek Banas on Youtube. There’s a lot of shitty instructors out there, but Derek is top fucking notch. Direct, clear, knows his shit, no annoying accent/mannerisms, and TONS of videos on various subjects. He’s absolutely the real deal. Take whatever language you chose, and whatever concepts you’re not confident with, and mow through those videos. Take notes. Writing stuff down helps re-enforce it in your head.
4) Practice practice practice. In the end, there is no substitute for raw experience. There’s tons of websites out there that give you practice problems, challenges, etc. I don’t have a specific recommendation here, but you’ll never learn to code if you don’t tackle some real problems.
5) Hackathons. Go to them. Don’t be afraid to not know what you’re doing. Go to anything that involves a subject you find interesting. There will be people there with utterly no clue, as well as seasoned veterans, and everything in-between, and nobody will shun you for not being a pro. That said, the smaller hackathons without tons of prize money seem to be way more fun, more educational, and just all around more enjoyable than the big high-dollar ones. And you’re probably not going to win anything your first couple hackathons, so try to go to a smaller one. The format is basically show up, people present ideas, split into teams based on interest in the ideas, and then code like crazy for 12-48 hours, and present your crappy app that’s held together with metaphorical duct tape to the audience. Judges vote on their favorites (the ones they feel have the most economic potential for success), and prizes are awarded. They’re tons of fun, and you can learn a lot from working in a team.
6) Consider a programming bootcamp. They can be expensive, but they’ll teach you rapidly and many of them have job placement. Barring this, come up with a project that’s challenging but achievable, and dive in. You learn way faster with a project you care about (and stick with it through more failure) than you will from random code challenges and problems without a larger context.
7) Learn to use Github. It’s a bit daunting for newcomers, as the user interface for pushing/pulling/forking/etc feels like something out of the age of MS-DOS, but version control is absolutely invaluable for organizations, and it looks really good to have lots of contributions as well as your own open-source projects on there when it comes to job-time.
8) If you have any trouble, want to know the best way to do something, or have any questions at all about code, Stack Overflow is YOUR BEST FRIEND. There is no more helpful, reliable, and trustworthy programming help site in existence.
Hope this helps to learn programming from scratch.