Learning to program is not learning a programming language. It is learning programming techniques. If you are still debating which programming languages you should learn, there is a post about it: Which programming language(s) should I learn?
Programming techniques are language independent. It includes concepts like modularity, problem solving techniques and more. Here we will talk about problem solving skills and how to practice them.
In the same sense that there are programming paradigms: functional, OOP, etc., there are also algorithm design paradigms. Some of the most well-know algorithm paradigms are: divide/decrease-and-conquer, transform-and-conquer, brute force, greedy algorithms, dynamic programming, backtracking and branch and bound. Algorithms design is by no means an easy subject. It requires skills and lots of practice to grasp the basics.
Problem solving is crucial to programming and the only way to improve is by coding and solving problems, right. I'm a bookworm. I believe that reading technical books is extremely important. There are things that you only know by reading books. It teaches you the technical and complex vocabulary of the industry among many other things. But you must do the exercises at the end of every chapter (in case of textbooks). Not all of them, but at least the important ones to retain the concepts and put the knowledge into practice.
However, this is not my favorite way of practicing programming. I find more interesting to practice on popular websites. There are many good websites to practice your programming skills. Just type "best websites to practice programming" on Google and you will find many suggestions. My two favorite sites are: Geeks for Geeks and Project Euler. Let me briefly explain why.
First of all, there are many websites for this purpose and there is no enough time to spend lots of hours trying them all. There is so much to know in the field that you probably want to split your time. As long as you allocate some of your time to practice coding you are fine. Besides, I do it because I like it very much. But it can be addictive. That's why it is wise to not over do it.
Project Euler. This is a website to solve mathematical problems using computers. They are not meant to be computationally heavy. Solutions, once solved correctly, should give an answer almost instantly in a matter of seconds at most. Why is it great? Well, I love math, at least the computational part of mathematics. And Project Euler will definitely boost your problem solving skills. The problems are quite challenging I must say. You will have to employ different techniques and program efficiently. Of course it will improve your math skills, especially in number theory. One thing I love about it is that you won't be able to see other people's solutions until you solve the problem.
Geeks for Geeks. I like this one very much for different reasons. It is meant to improve your coding skills in a classic computer science fashion. What I mean by this is that you will be able to practice/solve interview questions and also based on different categories: algorithm paradigms (the ones mentioned above in paragraph 3), data structures, sorting, etc. This site is great to prepare yourself for interviews. Contrary to Project Euler, people post solutions through comments and you can see them before solving the problems.
There you have it. Choose any website to practice, but make sure to pick at least one. You don't have to do it daily and I don't recommend it, but at least dedicate to them a few hours a week, even after graduating if you are a student. Happy coding!