What would you do?

CLo

My daughter is almost two years old. Every time we are in public and I need to hold her hand for safety reasons such as walking across the street, inside grocery store, etc.., she will say no, scream, sit down, pull her hand away from me, etc... it’s now a safety concern. I have explained to her in advance that she will have to hold my hand In hopes that would help but nope! how would you handle this with your child? I would love some advice! Thanks in advance!