The word "but" is a conjunction as it joins two parts of a sentence. The comma should come before the word but, not after.
It is important to ensure that the conjunction separates two independent clauses. A clause is a group of words containing a verb that can stand alone as a sentence with meaning.
I can't throw a rugby ball, but I am a pro at golf.
This can be broken up into two distinct stand alone clauses: "I can't throw a rugby ball." "I am a pro at golf." As such, the comma comes before the conjunction. In this case, "but".