The best way to do it is by building your own projects from scratch.
Udemy has some great courses which are well structured to learn the basics (how to write HTML then implementing CSS to style it)
After you get the hang of it you can branch out and learn how to create specific elements using YouTube, freecodecamp or w3schools.
I learnt from an experienced dev that "every second you're not coding, you're wasting your time".
Pick a project to build and figure out the rest through Google, YouTube, freecodecamp and w3schools.