When learning to code you may find yourself stuck on a challenge or a new topic you are learning. Know that this is ok, and happens to everyone. If it was easy everyone would learn how to code. When faced with these situations, try taking a break and revisiting the problem.
This is something that helps me to solve any problem I get stuck on. The feeling of being able find the solution is worth any confusion endured. Perserverance is a skill you will need.
One of the most valuable lessons I have learned so far is to make sure you are actually putting the skills your learning to practice. This might be working on a website, building an app, or just writing some code in a blank template.
Whatever it is you decide to work on, it's important to always practice what you are learning or reading about to really grasp the concepts. Plus, it helps train your brain to know how to apply these skills when using them in a real world setting, such as a job or paid project.