Usually the comma would come before "but," however this is not always the case so you must remember to check your punctuation to make sure it is right given the context of the sentence.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.