The answer to 'how to kill rat' is to use humane traps or call a professional pest control technician. Rats can be difficult to eliminate on your own and improper methods may be inhumane or ineffective. It's important to take steps to prevent rats from entering your home in the first place, such as sealing up entry points, removing food sources, and maintaining a clean environment.
If you do have a rat problem, start by trying humane traps that capture the rat alive. These can be purchased at most hardware stores. Place the traps near areas where you've seen signs of rats, such as droppings or gnaw marks. Check the traps regularly and release any captured rats at least a mile away from your home. If the traps are not effective or you continue to have an issue, it's best to call in a professional pest control technician. They have the expertise and tools to safely and effectively eliminate a rat infestation.