Science has already looked into this[1] (in the more "academic" aspect of learning, but I think it can be applied to anything really).

Most effective techniques:

1. Simulate you are being evaluated and take exams regularly. Your brain connections seem to strengthen every time you try to fetch information you already know, and nothing better to force that retrieving than a quiz. What you can do is create yourself a small exam with what you've learned today and take the quiz tomorrow. When you are creating the exam you'll think the questions are so easy (you've just learned them) but at the other day you'll be surprised by how many you don't remember/get wrong.

2. Distributed practice: Say you are willing to invest 800 hours learning something new. Would it be better to do it obsesively and cram them in in 3 months? Or to space them out over the course of a year? Well the more spaced the practice, the longer the topic will be remembered. Of course you need to put a lot of continuous hours at the beginning when you know nothing but after a time it's quite important to revisit the topic from time to time. Even revisiting learned topics once a year can make them stick long term in your brain.

3. Do not apply rule #1 by discrete topics, try to mix them up. There was an experiment where students were taught how to calculate the volume of four different solids. In one group they were instructed on how to calculate the volume of one solid, then they made exercises about that type of solid. After that they were explained how to calculate the volume of the second, made exercises about it and so on. In the other group they were given the instructions on how to calculate all four groups and at the end given exercises asking about all 4 methods mixed. They not only had to apply the formula, they had to choose which formula to apply. The results? The first group got 80% right right after they were instructed, whereas the 2nd got 60% right. But after one week? The first group got 20% right while the 2nd maintained the 60%

4. The why technique. Ask why and why like a little child in a chain until you get to foundational concepts / axioms. This way you'll get to the "first principles" or fundamental concepts of whatever you are studying. Building the "tree" before the "leaves" as Elon Musk says.

Anecdata: I learned german from 0 to 97% score in the B1 official test in ~7 months, while at the same coursing CS in the university and living very far from any german-speaking country. I tried to apply all the techniques presented here, for example I made dozens of preparatory test for every level I was... I tried to be doing something related to german all the time (chilling time was watching german movies, listening to german radio or playing german musik at the background hehe) ... I tried to mix up everything I could, for example anki-style cards are awesome, but you'd be very bored if you had to repeat them for hours every day. I also went out and tried to meet as much germans/austrians/swiss living in my city as possible (there are language events, tandem partner programs and etc in all big cities). But I think the most important factor to actually put the hours is motivation, I would earn a 1 year scholarship in Germany if I did learn german in a short time.

I tried to learn french a couple of years ago without a clear goal and was very unsuccessful.

[1] https://www.researchgate.net/publication/233088142_The_cogni...