Obsessive thoughts are often a sign of underlying anxiety. Quite simply you feel anxious and your brain looks around for a logical reason. I have suffered over the years with various forms of this - OCD and hypochondria included - but it really helped when I realised that whatever I was obsessing over was mostly just something my brain had dreamed up to explain away the unpleasant worrying feeling I had a lot of the time.
Dealing with the underlying chronic anxiety did require quite a lot of sessions with a private therapist which were not cheap because it wasnt CBT, but I have got on top of it all now. I know not everyone could afford the therapy and I was lucky I could.
I also find being really busy doing things which are focused on other people really helps. As an example I volunteer with the Royal Voluntary Service, taking a convenience trolley round ten wards each week at the nearest hospital. Once I have spoken to thirty or more patients, who often have actual really serious health problems, my own worries seem to shrink into insignificance. Its not depressing, nor does it make me worry I might end up with whatever they have got - in fact its quite amazing to see how people cope with adversity and very uplifting.