You should try and take a deep breath and go to a quiet place. Read your homework aloud then focus on your main goal, finishing it. Think about what you did in class if you don't know how to do it, search up a video, something that can help you. I've learned in the past that clearing your mind can help.
Hope this was helpful. :)