Beyond just sticking with it, you also need to continually challenge yourself. Avoid staying into the comfort zones that fear and ego will shunt you into.
These are very difficult to do as a beginner because you're going to encounter so many demoralizing roadblocks. I still remember when I first started writing code. It was incredibly painful. Things that now take me minutes would take days.
The real key here isn't some technique that will make the learning easier, it's in getting the emotional fortitude to push through these struggles. Your struggles will be unique and it's impossible for me to prepare you with solutions for every novel challenge you face. "Ask not for lighter burdens, ask for stronger backs" and all that jazz. There's a lot of resources online, esp. on Youtube, about increasing mental discipline. Cold showers, fasting, mental discipline, stoicism, etc. I recommend investing some time into trying these techniques for improving pain tolerance.
If you want to solidify your knowledge, make a 30-min talk for your peers about the topic. Commit to make it perfect and be prepared for their questions.
And remember that friendship must be actively maintained.
You have to be comfortable with making mistakes and being bad at things, because it happens a lot when you're just getting started.