jon is right. You have to learn the gender of all nouns. Then you easily can decide whether you should use -t or -n like ingen/inget, fantastisk/fantastiskt, vit/vitt, röd/rött, stor/stort, gullig/gulligt and so on.
I don't know any rule for this but I can tell you that almost every animal ends with -n. I was thinking about this for a while, and I've found two animals which doesn't end with -n and that's lejon (lion) and marsvin (guinea pig). Otherwise, you just have to try and learn.