I put on music, preferably with full coverage noise canceling headphones to block as much outside stimulus as I can. Depending on the mood, I might put on something soothing (listening to Sean Townsend on YouTube right now) or I might go with metal.
If you are in US K-12 education and have a diagnosed condition (depression, anxiety, autism, etc.), you can have your parents request a 504 plan with the school. This requires the school to make reasonable accommodations for someone with a disability or illness that makes it difficult to be successful otherwise. When my daughter was suffering with anxiety and panic attacks, we worked with the administrators to setup safe places where she could go to calm down. The teachers were required to let her go any time she needed a break from the classroom.
When I was in the office, always metal. At home I’m more likely to listen to classical, but still metal if I need to be totally focused.