1. I cut my caffeine intake to zero.
2. I forced myself to sleep at about the same time each night. (most important)
3. I stopped using alarms. I wake up when I need to.
4. I wear a sleeping mask which helps me get an hour more of sleep. Otherwise I'd be awake at the first lights of dawn.
Once your circadian rhythm is retuned, points 1 and 2 stop being so important. I no longer have trouble sleeping if I drink a cup of coffee. And if I go to sleep late once or twice, it does not ruin my sleeping for the rest of the week.
But if you want to get dexterity in some field, i.e. being able to actual solve problems, I think it would not work so well. I think there is a difference in how the brain stores and recalls information in this case. If you learn a definition by heart or learn a proof technique by heart, you would be able to recall it perfectly when asked directly for it. However, I suspect that when you would be actually solving a problem and you would need to recall this information your brain would not be able to make the connection.
That is why in mathematics one is usually required to solve a lot of problems and why studying the theory by heart does not help much. When you do a lot of textbook problems you brain starts making connections between the chucks of proof techniques and the chunks of definitions and the chunks of whatever features your textbook problems have. Those connections are the most important part of learning mathematics and you would not get them by simply learning facts.
Basically, to say it in another way, you would learn the theory, but you would not learn the problem solving associated with this theory.
Source: I studied mathematics, the wrong way for many years.
EDIT: The most bitter experience I had studying mathematics. It was the first year of my graduate studies and I took an undergrad class in Graph Theory as my introduction to discrete mathematics. Since I was now a graduate student I decided to approach the class in the graduate student way. That means I focused really hard on learning the theory and learned all the proofs and all the proof techniques that we went through. And that was very fun because the proofs in Graph Theory tend to be very elegant. And I fell in love with the field. And then came the exam and I was feeling really good about all of this, because for maybe the first time in my life I had learned 105% of the theory required for the exam. That was the worst grade I got in my whole mathematics studying career. The problems on the exam were much simpler than any example or theorem encountered during class, but I just could not make the connections between the proof techniques that I had memorized and what I was looking at on my exam paper. I retook the exam three years later (it had no influence on my grade at this point), with very little preparation, but the preparation was 100% in solving exam type problems. I could maybe recall 60% of the theory and proof techniques. I got top grade.