I stop rats invading my garden with easy job from Monty Don and Alan Titchmarsh
As the temperature continues to drop, rats are the main pests that come into gardens. Following a warm summer, which has created favourable breeding conditions for these pests, autumn brings an increased risk of infestations as they come to gardens in search of food, warmth, and shelter.

TL;DR
- Rats are attracted to gardens in autumn for food, warmth, and shelter, especially after a warm breeding season.
- Compost heaps attract rats due to the heat generated by rotting vegetation.
- Avoid adding meat, fats, cooked food, or starches (like potatoes, rice, pasta) to compost.
- Maintain a mix of 'green' (nitrogen-rich) and 'brown' (carbon-rich) materials in compost.
- Keep compost heaps covered with no gaps or holes to deter rats.
- A tidy garden with short grass, clear storage, and reduced overgrown areas is less attractive to rats.
- Secure rubbish in tightly sealed bins and dispose of waste regularly to avoid providing a food source.