What do you do with you crying/screaming toddler in the store?

I just want to know what you guys do with the situation. My son is 2 and I’m honestly not sure how to go about it. And sometimes he gets quite extreme with it. Let me know what works for you! Please!

I must add, he usually only gets upset when we go out and about with dad because he knows dad will let him roam free out of the cart. But it’s just super annoying because he will run off and my husband is apparently okay with chasing him. But when it’s just him and I, he’s great! But usually he will cry and cry when we don’t take him out of the cart.