What I normally do is read the sentence and add the comma where I hear myself use a longer pause than normal. Commas are also used to separate items in a list.
Use a comma after the first independent clause when you link two independent clauses with one of the following coordinating conjunctions: and, but, for, or, nor, so, yet. For example: I am going home, and I intend to stay there.
Use a comma when you're providing a series of examples: a banana, a watermelon, and a grape. Use a comma before conjunctions (and, but, or, so, yet): We went out for dinner, but I forgot my wallet. Use a comma AFTER a transition word especially when writing one paragraph to another: However, she... Therefore, I decided... Other than that, we... After that, I... So, I... Also, there... Not to mention, he.... And etc. You can find more transition words here: https://www.msu.edu/~jdowell/135/transw.html Use a comma if you are describing something that refers to your previous sentence, like those descriptive lines or information dished out like an interruption to the whole thought: I looked at her face, the face that used to be filled with so much joy, and I... Use a comma if if you are going to use a verb to connect two thoughts: I looked away, regretting every bit of my actions.