Friends, just don't put your hand in your pocket, simple. If its a situation where you are in a cafe for instance, ask for the bill then offer up some cash saying 'well there's my share'.
Family, well that's a bit different. I guess your family may think you are a money tree, and unless its a family member you know is struggling, then I would take the same action as for friends.
no dougie
in the days when I did this
you havent had a muther drawing herself up and saying - 'I am oonly paying for what I ate!"
1973 - I made up the £5 deficit ( jesus £50 2022) as everyone underpaid whilst saying "I am oonly going to pay my share and no more!" - with the satisfied look of 'no one is going to screw me for a pennymore than I owe!"
and I really didnt go for another gorup meal again ....