I'm going to yell fuck off to my friend in class
Why would you yell that at your friend?
He said something stupid to me and told me to shut up because I was talking too much
Even if your friends do something wrong you shouldn't tell them to fuck off. It will not make the relationship better.
I'm still going to yell at him.
I think you need to calm down a bit, you shouldn't say such things to your friends, especially during class. Your teacher might be really mad.