Hey there!
I can understand how our thoughts gets uncontrollable at times especially when something bothers us or hurts our feelings. It's a vicious cycle that gets created. And our thoughts play in our mind on loop then and we feel hard to escape from it & our eating and sleeping also gets affected in this.
Next Steps
However a proper detail diagnosis need to be done a counselling psychologist. So they can access your issues better understand the root cause and give you therapy based on that.
Health Tips
Notice if your thoughts are making you feel tired or if it is making you feel restless.
Notice how your body is feeling while you are overthinking, and any sensations or pain you feel in the body.
Also, take a few deep breaths while noticing how you inhale and exhale. Notice your breathing for 3-5 minutes every hour or two and before sleeping too.