The most effective method of getting rid of rats is by using a combination of methods, including sealing off entry points, setting traps, using rat poison, and keeping food sources tightly sealed. It is important to identify and address any factors that may be attracting rats to the area in order to prevent future infestations.