Some bad thoughts are what are known as "intrusive thoughts" to psychologist and are an extremely normal aspect of the human cognitive behaviour, although perhaps more obvious to those with anxiety disorders, as such intrusive thoughts can be more frequent.
In Buddhism, they call the intrusive thoughts simple mind chatter and part of the stream of consciousness we have.
The aim of Buddhist meditation is generally not to suppress such thoughts or feeling bad for having such thoughts,
but learning to allow the thoughts to arise and then disappear on their own without feeding them (by grabbing on to them and freaking out, which turns the unavoidable into a bigger problem which becomes impossible to deal with if you give them too much attention).
There are all sorts of types of meditation designed to help people let go or take less notice of such thoughts.
Some forms of meditation are very relaxing. I am presently taking daily walks (on the beach), which is very therapeutic.
Listening to the sea swish in and out, blocking out the human world is generally very calming, as well as some exercise.
Perhaps you could also find somewhere to walk. If so, one meditation technique to help clear the mind
is to count each step, counting up to ten, then starting all over again.
The object of this exercise is not to count as high as you can,
but to use the counting as a method to take your mind away from your disturbing thoughts.
If you are unable to walk, you can learn to count to ten by breathing in and out.
That can also work.
Use the counting to distract you from your disturbing thoughts, and remember thinking isn't the problem,
we all think and all some times have bad thoughts which appear to come from nowhere.
The problem starts when you dwell on the bad thoughts and allow them to become a regular feature, which then drives you to act on your thoughts.
Then it would be a problem.
Hope that helps. Please feel free to disagree with what I have written.
Although i have written the above with a genuine wish to help.
Cheers