Rats are attracted to your home by the smell of food and the promise of a warm shelter. You can use their sense of smell as a way to keep them at bay. Rats hate the smell of peppermint oil. Placing cotton balls soaked in peppermint oil in the corners of your home can help keep rats from coming inside. You will have to remember to change these cotton balls every few days in order to keep the rats out.
The alternative to killing rodents instantly would be poisonous bait. They're a pretty common way to kill rats in industrial locations and are effective as well. However, I highly recommend staying far away from poisonous baits if there are kids or pets at your house. You may just end up seriously injuring someone else. Rat poison might not kill pets and kids straight up, but it will make them seriously sick.
Mousetraps are the classic way to kill rats around your residence. Ever since the old Tom and Jerry, mouse traps are widely used all over the world. However, it is worth noting that the mice may not die instantly from the traps. They might just seriously wound the rat instead of killing them, which can be a pretty messy cleanup job depending on the number of rats around your place. If you use sticky traps, they're a prolonged and inhumane way to kill the rats.
In order to rat-proof your home, you need to make sure that every possible nook and cranny is sealed so that the rodents can't find their way inside anymore. Make sure to double check the outside of your home and seal any cracks, holes and other spaces where animals could get in. Rats can also used drains to get in so make sure to inspect those for any damage. You can use caulk, cement or other materials to seal the holes. If you're not sure where the rats are coming in from, consult an expert.