Mr Stink by David Walliams. Ages 7+.
Mr Stink (2009) tells the story of Chloe, a twelve-year-old girl who is largely invisible in her own family. Her mother is a fiercely ambitious local politician; her father is meek and ignored. Chloe herself is overlooked entirely.
On her way home from school, Chloe begins talking to Mr Stink — a smelly, dignified tramp who sits on a park bench. He smells terrible (he has two dogs named Duchess and an unnamed stray) and is avoided by everyone else. Chloe finds him surprisingly interesting.
When her mother's political campaign promises to 'clean up' the town by moving on rough sleepers, Chloe hides Mr Stink in the family's garden shed. He lives there secretly for weeks — helping Chloe's father with the garden and becoming, unexpectedly, a positive presence in the family.
Mr Stink's backstory is gradually revealed: he was once wealthy and successful, and lost everything after the death of his wife. He chose to live rough rather than face a world without her. The novel ends with Chloe's family changed for the better and Mr Stink choosing to move on — but on his own terms.