One of the best ways to learn is to do projects. If you don't have any idea (yet), then there are some on the internet, or you can start by doing programming challenges on codewars, leetcode and such.
Source - I learnt basics of 5 programming languages this way (Python, JS, TS, C#, C++)