Regarding the switching between different subjects or projects, what helped me was to quickly write down TODO notes of actions I should immediately take when picking up the subject again. For example "Finish exercise X", "Watch lecture Y" or "Run unit tests of project Z".
I found my self dive in to the subject much faster when there was no need to think about where to start.
Often at the end of the day I'll do a mental stack dump of where I am in various projects, including the immediate next steps, in an email and send to myself to easily jump right in the next morning.
Plus one for this. Emailing a a couple of bullet points to yourself at the end of the day so you've got a launch point the following morning really helps avoid that dangerous first 10 minutes in the morning where you sit down at the computer with a coffee and get tempted to click on to HN/reddit/whatever while your brain goes over what to do for the day.
With the list you sent yourself the night before you can dive straight in and avoid getting distracted before you've even started!
I found my self dive in to the subject much faster when there was no need to think about where to start.