The order that actually works
Integrated pest management guidance treats this as a sequence, not a menu to pick from: inspect first to understand what's actually present and how it's getting in, then exclude by sealing the entry points with metal or hardware cloth (materials rodents can't gnaw through, unlike foam alone), then address anything already inside with targeted trapping. Doing exclusion before dealing with an active indoor population risks sealing animals into a wall cavity; doing trapping without exclusion means new arrivals just replace the ones you removed. The order is what makes each step actually pay off.

