Being in my mid 30's, I haven't been in a learning environment in more than a decade, but I have used learning in my day to day life working as a hotel manager.
Learning new things is always a part of our daily lives, but learning a technical skill, such as coding, is much more in depth. You have to adhere to strict syntax or you'll produce an error. You have to map out your program or app, or else you'll be stuck in a loop you can't exit.
I've always thought having a basic structure written out for what you want to accomplish is key. When I was training front desk staff at a hotel, I would give them a detailed outline of what needs to be done in order to complete the task at hand down to the keystroke. I took the check-in process and broke it down step by step, and unsurprisingly after a few times repeating the process, a brand new front desk agent understood how to do it without looking at notes!
Coding, no matter what language you chose to work in, is complex. Just viewing a tutorial or watching a lecture might not be enough for you to be able to grasp higher level concepts right away.
Taking notes is incredibly important when learning to code. When starting Flatiron School's software engineering program, I relearned my note taking process and adapted it coding. Here's a snippet of my notes from the creating migrations portion of ActiveRecord:
What I did was type out the actual code that's needed for the process, and added my own notations to clarify where I'm doing that process (in the text editor terminal, or in the rake console for this example). I've also noted the proper syntax for creating a migration.
Now, doing all of this was time consuming. I watched a YouTube video of the lecture, and while watching I paused the video to write down each step, then resumed. Repeat until all the steps for what I wanted to accomplish was laid out in a format I understood.
Writing out your notes and adding comments in an easy to read format will definitely help a newbie to coding understand what's going on. Having each step written down one by one, especially if the video you're watching bounces around a bit to test out code or show a different example, will clarify the steps needed to accomplish your task.