Both those commands are executed off the GCD, effectively at the same time. It doesn’t act in a sequence. 1 click doesn’t activate attack and the 2nd activate follow, 1 click triggers both attack and follow.
Pet follow doesn’t make a pet stop attacking. It cancels out orders to stay and move to a specific spot from /petstay and /petmoveto
/petpassive and /petassist and /petdefensive change how the AI acts with respect to attacking
pet assist is the most aggressive and the pet will continue attacking without repeatedly being told to attack.
pet passive is effectively a “stop attacking”. You can order it to attack but it will hit once and run back to you. If you want it to continue attacking you have to spam /petattack
pet defensive is in between. In theory if something is attacking you or the pet, it will attack it but I found that the pet won’t really do anything until you order it to attack and then it will attack that 1 thing until it’s dead, and run back to you. With this you need to switch targets just before something dies to keep the pet from losing time by running back to you.
The simplest approach is to make sure the pet action bar has at least Passive and Assist on it and click those things to make the pet stop.
I also have a macro that is assigned to a specific keybind
/stopcasting
/stopattack
/petpassive [pet]
/petfollow [pet]
It stops my autoattacks and makes the pet stop attacking and run back to me. The “[pet]” is a conditional that only executes the line if I have a pet out without it I would get an annoying “i can’t do that now” message.
And then at the end of my macros for casting attack spells i have
/petattack [pet]
/petdefensive [pet,group]
/petassist [pet,nogroup]
If I’m in a 5 man group my pet gets put into a defensive mode. Not as much dps output but it tends to run off on its own WAY less. Otherwise if I’m not in a 5 man group (solo or in a raid), the pet is in assist mode.