It is really difficult but what I did was to focus on what I was doing. If I was studying for school I wouldn't think about anything else and if I was coding I wouldn't think about school. Sounds simple but in reality it is really difficult.
I would suggest you to stay focused and also take regular breaks as constant hustling also has its cons.
Happy coding!