Many badgers visit gardens for food put out for them or birds. They will eat most leftovers, windfall fruit, etc, but take care to avoid putting out large quantities of processed foods such as cake (which is just as bad for badgers as it is for humans).
It may also be wise to avoid leaving out things such as the remains of cooked poultry carcases; although badgers, who love to strip the remaining meat and get at the marrow, will not be harmed by the spiky cooked bones, domestic pets may try to take a share and in their case brittle cooked bones can cause problems.
Some badger-watchers pile stones over such treats to deter domestic pets. Stirring peanuts into loose sand means the badgers have to spend more time extricating the food, so you get to watch them for longer!
Notes: Avoid leaving out foods like chocolate, milk, cream, cheese and other dairy products. Many animals can be harmed by fairly small amounts of chocolate, and hedgehogs will eat dairy products, even though it can harm their digestion!