It can help to just steer well clear from anywhere distractions can be found. For example, install a blocking extention like Intention to forcibly remove yourself from being able to even browse youtube during focus hours. Or get your music from somewhere not prone to leading you down a rabbit hole of distractions.
Proper music selection can also really help.
At our core, we have two different types of attention: conscious and unconscious. When we have a task at hand, and want to get it done, we give it our conscious attention, and work to focus on just that task while ignoring other external distractions. But while this is happening, our unconscious attention is still at play, and is constantly looking for other things to latch onto - be it a sound in the room, an advert on the side of the page, or a distracting recommendation after an educational YouTube video.
The point at which your conscious attention gets fatigued from trying to ignore these temptations is when that lack of focus occurs. Researchers think that ADHD could be caused by a malfunctioning area of our brain which controls our conscious attention.
Music of the correct variety can help to keep that unconscious attention satisfied and stop it overriding our specific intention to concentrate on that key task. It does this by cutting out a whole area of distraction possibilities and replacing it with something just enough to keep our unconscious attention satisfied.
The reason ive looked into this is because im building a side project around focus music:
https://www.flowful.app/