How do I focus and stop getting easily distracted?

Look at environment. Best way is to reduce distractions around you. Move to a more quiet place. Take note so you rely less on your memory. Contrary to popular values, don't multitask if not necessary. Instead, take a short break and go back to the original task.