First of all for the many on going and unstoppable thoughts, I would suggest you learn meditation and practice it twice a day for 15mins per session. This will help you clear your head and focus on the important things. Secondly when you feel the thoughts growing on in your head and are unable to concentrate on work or study, use "Breathing techniques for Anxiety" which will help you focus on that bit.
Next Steps
try consulting a psychotherapist or a counselor for the same