It is sad to know that you are in this state but the good part is that you can come out of this.
Overthinking , getting captured with self defeating or intruding thoughts are definitely very unhealthy
They may also cause excessive activity in your brain that can be harmful to you leading to anxiety.
So to treat them
1 . Identify what is the root cause if these thoughts .
2 . Identify the exaggerated part of thoughts
3 . Reconstruct new thoughts that are more healthy , real and rational .
This all we do through various psychotherapies.
You can reach out for Counseling as well .
Self help tips
Medication , practice relaxation and mindfulness.
Next Steps
follow self help tips and counseling