This is basically what OCD is
A cycle of worrying thoughts followed by rituals that you do to try and feel better, more in control and less anxious.
Obviously, the rituals themselves begin to take over your life because they take up a lot of time.
They can also really interfere with school, friends, and your family life, making it hard for you to enjoy yourself.
At this point a doctor might diagnose the problem as Obsessive-Compulsive Disorder (OCD).