Answer:
Practice focusing and just doing work! There are heaps of techniques to use. If you are struggling to do work/focus, a good one is the pomodoro technique.
Basically, you work for 20min (or maybe shorter) then give yourself a 5 minute break.
It helps you focus by giving structure to your work and letting your brain understand that there will be a break soon, just do some work first. This stops things from distracting you.
It also gives you time to process what you've just been doing, and reflect and reevaluate your work.
As for the essay thing, I used to struggle on English essays a lot. It helps to remember/write notes on essay structure. I'm not sure what level you're at so I can't give specific advice.
Explanation: