In this case one must suppress it. To prevent even greater
karma. But one must progress from that 'suppression stage' to the
'elimination stage', because supression is only temporary and does
not solve the problem at its cause. And as namelessness said,
supressed thoughts will return.
Chanting is a useful method to suppress these thoughts. Chanting
has three levels. First is like putting a stone on weed to prevent
them from growing (i.e supressing). Second level is to uproot the
weed (this level = arhat/hinayana). Third level is 'no-no-chanting'
or 'no-no-thought' (wu wu nian), is even higher, it is bodhisattva
level.
You can supress first but then later one must go beyond supressing,
and uproot the 'weed'.