There is no universally agreed way that could be called the correct one for everyone. People come from different backgrounds and different learning methods work for different people.
Once you're familiar with the basics, it's a good idea to avoid courses where you follow along someone else coding because this won't teach you how to think. Instead, it's better to learn how to figure things out yourself.
I recommend you to make you first simple website. Once your website works, learn to make it responsive. If you don't know what this means, figure it out using Google. A major part of programming is knowing how to figure things out and even very experienced programmers often need to use Google when they write code.
- If you want to make websites, learn a frontend framework like React, Vue, Angular or Svelte.
- If you want to make servers, learn about things like Node.js, Express, networks, REST and databases.
- If you want to make mobile apps, learn e.g. React Native
- If you want to make desktop apps, learn about Electron for example.
Now, the way I'd recommend you to learn is by working on a practice project. Decide what you want to be able to make, make a list of all the different things you need to learn to be able to do it and start learning them one by one.
After some time, you'll have a finished project. It will be written so poorly you'll barely understand the code yourself after you're done, and it will probably work only when you use it and someone else will be able to break it because of some mistake you didn't notice.
This is okay, though. You made a bad app but you learned a lot in the process. The next app you'll make will be better and by the time you're done with a few apps, you'll be able to make decent apps and it will take you significantly less time to do so and you will gain confidence. This is when programming becomes fun.
If you get stuck and really can't figure out how to make something work, send me a message and I'll try to help. I don't have time to teach anyone to code but I'd be glad to nudge you in the right direction if you need it.
Lastly, I'll give you little extra tip for planning projects which I learned the hard way: Plan your app in advance. Figure out what are the most important features the app needs to have so that it contains the necessary parts and nothing extra. Once the app is up and running, you can add more features to it but you will already have a usable app by that point. I have given up on a lot of projects after wasting a lot of time on them just because I kept adding more and more things to them and eventually felt like they were never going to be done.
Say you're making Reddit. Make an app that allows people to make text posts and comment them. Forget pictures, videos, upvotes, subreddits, user-to-user messaging, premium subscription models and all the other extras. Finish the app first and add the nice to have features later.