This site and this site both speak of an nbt path which allows me to put a certain value (say, the durability of the currently held tool in a player's hand) into a scoreboard. The wiki describes a path like this:
path (Optional) Specifies the path to the targeted NBT. Data paths look like this: foo.bar."A [crazy name]".baz. foo.bar means foo's child called bar. foo means element 0 of foo. "quoted strings" may be used if a name of a key needs to be escaped.
However, I don't understand what they mean by this. I know foo and bar are just dummy programming terms and that  are for indices (say
Motion), but I don't understand what the child and string notation is/how it is used.
This post has
/data get entity @e[type=minecraft:villager,limit=1,sort=nearest] Brain to get a villager's home location, and I have used
/data get entity @s Pos before, but that is getting nbt about an entity specifically, not the contents of their inventory.
If someone could explain what the wiki excerpt means (preferably with examples) and also an example of getting nbt from an inventory item (again, say, the durability of the currently held tool in a player's hand) that would be very helpful.