I suggest you watch something quietly, and then concentrate on a problem seriously, so that you can calm down slowly; In addition, calligraphy and painting can also improve one's concentration; Finally, there is another way, which I think is said by a crosstalk performer every day. What he said at that time was to practice his eyes. In fact, I think he can exercise a person's attention again. He said this: There used to be a kind of incense, a red incense burner. Blow the burner and chase the red dot with this eye. I think this method is also good.
Take part in more physical exercises, watch movies, listen to songs and relax yourself.
Come on, I wish you progress in your study.