Negative thoughts can be troubling. They can dim attitude and darken your mood, and sometimes, they creep to the forefront of your mind without your license or bidding. Things you would never voice, obscenities you would never enact churn for some reason, dark monsters rising to break the surface of the ocean of your consciousness. It takes discipline and focus to entomb them in the depths where they belong.
You must take comfort though, that no matter how dark these thoughts are, no matter how these flights of fancy drag their wings through filth and dross of the depraved and deranged minds, they are nothing but thoughts, insubstantial and easily dismissed with a thought of better quality.
For no matter how evil thoughts are, they are only thoughts. There are far worse shapes that darkness can take. Those that give over to temptation and indulge the thoughts in their heads go to the next level - deeds of ill will. These are far more substantial and have far more telling effects. Unlike dark thoughts, a common and tragic result of dark deeds is the victims that are left in their wake.
So seek forgiveness for your ill thoughts, be humble and ask for peace of mind and calmness of spirit. Do not dwell on such ill minded feats, for they have no place in the minds of the righteous - but the mind, like the flesh, is still tainted with evil. All you can do when you fall victim to negative thoughts is to be more positive and drive them out of your mind. It is the devil trying to poison and turn your heart away from light and grace. Resist it. Be steadfast, and try to keep up more practices of self discipline. We all slip up. As forgiveness and continue on.
God knew what you were going to think, and to do, before you ever did it, but he still let his son die for every last sin. There is no greater mercy or grace than that. Do not be discouraged. Be more positive than negative, and dark thoughts will have a harder time rooting into your mind.