Discipline is not just about rewards and punishment though.
Other ways to encourage the behaviour you want would be:
Modelling what you expect
Explaining and setting clear expectations and boundaries - mot expecting young children to remember every time
Physically preventing something (for example, I cannot imagine merely asking a child to hold my hand near the road- they would be restrained or attached to me until such point that I knew they were more responsible)
Age appropriate expectations
Finding a win win solution
Presenting an appropriate outlet for behaviours
Looking for root causes and dealing with/working on those
Identifying the opposite, the positive behaviour you want in lieu of the negative behaviour and emphasising that in various ways
Talking about stuff
Recognising smaller signs that bad behaviour is coming and intervening or teaching the child self management strategies
Noticing a pattern of triggers for the behaviour and avoiding these or managing them better or teaching child to manage them better
Love and acceptance, encouraging a child to see themselves in a positive light
When a child is having some kind of extreme behaviour like screaming, hitting, tantrums, usually no punishment or reward is going to get through to them in that state anyway. So you need immediate damage control e.g. removing them from the situation or sometimes removing the trigger ie you, stop responding or take yourself to a place they can't reach you, some children will unfortunately need restraining when they get like this for their own and other's safety, most will burn out once their audience is gone.
Longer term you can enact a consequence if you want but what really helps is the other stuff, working out the root cause, what's the trigger, is the expectation fair for this child, do they struggle with things others can do, are they getting enough sleep, food, activity, attention? Can they learn strategies to help them cope better with whatever set them off and react appropriately?
Simply punishing this kind of extreme behaviour rarely works and usually makes things worse, you have to put other frameworks in place as well. Since these other frameworks are actually what helps, you may as well dial the punishment part right down to something which is inconvenient for them but not frightening, or in some cases omit it altogether. What you need to not do is keep heaping on more extreme punishments in the moment to try and force them to stop. A child reacting this extremely is not doing it for fun. They do it because they don't know another way to get what they want or how to accept not getting what they want. These are both things you can help them with.