I take an amphetamine pro-drug (Vyvanse) and I'm incredibly reluctant to recommend it any time someone expresses trouble with motivation/focus.
But it did change my life at that critical I-don't-know-how-I'll-make-it-through-university moment. Especially when everyone around me offered stellar advice like "try harder" and "don't buy in to the Big Pharma ADD/ADHD-conspiracy".
It turns out that I'm also reluctant to just offer "exercise more!" or "work on yourself -- it's your behavior!". It's frustrating and anxiety-inducing enough to struggle with motivation. If the only solution is to put pressure on such people by suggesting it's all in their head, then what do we do if that pressure doesn't actually fix anything? Do we count down to the catastrophe so that we can chime in one last time with "See? Look what you did."?
Exercising and taking a sabbatical are good advice, but sabbaticals are out of the question for most people (especially a kid in highschool), and exercise is only that -- good advice.
At some point we have to admit that the results of no-improvement will out-trouble our concerns/stigma over last resorts like medication.
Don't compare aniracetam or oxi to amphetamines (or ritalin) - the former is legal and safe enough, and the latter is much more dangerous and ineffective (in terms of concentration enhancing). I would never ever recommend amphetamines nor ritalin, cannabis or other "useful" drugs, that always make you want to take more of them. All what they can give is faster burnout of your brain and state of lack of energy (also, problems with your skin, thanks to amphetamine overdose).
What OP was talking about was not psychostimulation, but concentration enhancer, something that would just reduce effects of "mind wandering" and let him do tasks that he doesn't want to otherwise.
Aniracetam and oxi do greatly reduce effects of "mind wandering", large amounts of grains and fruits give your brain very much glucose, i.e. energy to use to, coffee increases your metabolism and blood flow, and gives a slight stimulation, so you can force yourself to do task more easily.
Don't overuse coffee, though, it's effects can last from 1 to 3 days (or even more).
But personally, I would recommend intense and sustained cardiovascular exercise.