HI @dannyparker !
Welcome to the world of programming. 
We have all been there and this will never go away. But the satisfying thing is when you work through a tough problem and finally arrive at an answer. That is where the real learning and growth comes in.
One of the reasons why most beginners quit programming is because that expect the learning process to be much smoother and quicker then reality.
To get good at programming will takes years of study, practice and solving problems.
So the key is to take it one day at a time chipping away one bit at a time.
Through time and practice these concepts will start to make sense.
Some days you will have a breakthrough in understanding or solve a problem.
Other days you will run into a tons of errors and be stuck.
But all of that is part of the learning process.
Most people view errors, setbacks and issues as permeant failures and signs to quit. But that isn’t true.
That is where the real learning comes in.
Getting stuck on something or not understanding something is the first step to becoming a better programmer. It forces you to read more documentation, learn from error messages, ask better questions and tests your problem solving skills.
Motivation comes and goes. So it is best not to live by that to stay on course.
There are going to be plenty of times where you won’t want to code but you should keep studying anyway.
it is better to focus on building small sustainable habits and systems so you can be successful. Consistency is what it will take to get you where you want to go.
When I was first learning in 2020, there were plenty of times where I wasn’t motivated to code. But I coded anyway because I knew continual practice and consistency was what was required.
I worked through the freeCodeCamp curriculum and built side projects a long the way.
I also got involved in the community and networked and built connections a long the way.
I think consistency and networked is what helped me land my first job.
Learning how to code is hard.
But the key is to keep going and push through the hard moments and not expect everyday to be a hit and homerun.
Some days you will walk away frustrated because something doesn’t work. But that is still part of the learning and growing.
I would also suggest you listen to Quincy’s advice for learning because it will be really helpful