I once read (and I wish I could for the life me remember where so I could source it) that when you’re learning to code, always type out the code examples and never copy and paste them. I’m not one for anecdotal information but it stuck with me and I actually have committed to it.

Coding is like music, there’s a rhythm and logic to it. Copying and pasting is the quick way but if you’re a seasoned programmer jumping languages or just learning HTML, type out the statements rather than copy and paste. 

You might not understand it all or even most of it but over time you’ll start feeling the patterns and soon you’ll start deciphering the melodies underneath.