There are many classifications for sin, one concerning the thought of sinning (CCC 1853). I can not really comment more without knowing more about what this “bad” is.
I’d say it was a sin to consider doing the bad thing, but probably just a venial sin. Presuming that you no longer intend to commit that sin, you were saved from committing the more grave of the sins.
DISCLAIMER: Catholic Answers has turned over the archive to Catholic-Questions.org and no longer owns, manages, or moderates the forums. For additional apologetics resources please visit www.catholic.com.