When most people think about consent, they think about sexual contexts. In reality, consent is important in non-sexual situations, too. You need consent before you borrow or touch someone else's stuff, get in their personal space, or show up at their home.
You (hopefully) wouldn't just go up to a random stranger and hug them without asking. You wouldn't just take someone else's car for a spin without permission. Those are examples of non-sexual consent. The same principles of consent that apply to sex also apply to those circumstances.
In many non-sexual situations consent is implied. For example, on extremely crowded public transit consent to politely stand in someone's personal space is generally accepted but it would be weird to stand that close to a stranger in a park at night. In other situations, consent is much more nuanced and requires negotiation. If you aren't sure, just ask!
It's especially important to be careful in how you navigate consent with children. Modelling healthy consent in non-sexual contexts with children helps them understand that their bodies are their own and they have the right to feel safe and comfortable, too. It protects them from predators as children, and sets them up to navigate consent in healthier ways as adults later in life.
Consent for hugs is frequently ignored with children. Many children are forced to give or accept unwanted hugs from family members and told they're being rude or unfriendly if they don't cooperate. This teaches them that their bodily autonomy doesn't matter, and makes them vulnerable to sexual predators. By allowing children to set their own boundaries around what kinds of non-sexual physical touch they are comfortable with, when they want to receive that touch, and from whom, it helps them learn to recognise and enforce their own boundaries. Those skills are incredibly valuable later in adulthood when they begin to navigate sexual consent both with their own bodies and with the bodies of their sexual partners.
For more information on consent: