First off, clean up or get rid of what is attracting them. Clean up trash that is left out, close your garbage cans, and put away in food or organic material that would attract rats. If you live outside of the city, a cat can be a nice addition since it's a natural rat killer.
The second thing to do is to seal your house. No matter what rat killer method you choose to get rid of rats, it will be useless if additional rats are allowed to come into your home to replace them. Do a thorough inspection from bottom to top of your home. Check for cracks and holes in the side of your home and crawl space. Also check the eaves under the roof. Seal these holes and cracks with steel mesh to keep rats out.
After getting rid of the things that attract rats and sealing off your home, now it's time to pick a rat killer method. Two common methods are poison and snap traps.
Poison is effective as a rat killer, but its use is somewhat limited. Rat poison should not be used around small children or household pets. Also, the problem with poison is that when the rat dies, it usually dies in a place where you can't find it. So rats tend to die in the walls, attic, or ceiling and all you can do is smell the horrible stench but can't locate the body.
Another rat killer method is snap traps. These are spring loaded traps that come down on the rat and break its back when it takes the bait. These are pretty effective but rats sometimes escape and you must touch the dead rat to dispose of it.