To prevent rats from living in your yard, you must deny them access to shelter. Keep your yard nicely trimmed and remove any piles of wood, brush, debris, compost piles, dense shrubbery, ground covers, and ivy as this will attract rats over time.