Basically, isn’t killing a living being a sin? But we use repellants to ward off, in fact kill the mosquitoes, and traps and rat poisons to kill rats, and we hit cockroaches when we see them inside our homes. Now is this right? If these aren’t done they prove to be a big menace for us.

All the main religions (viz. Hinduism, Islam, Christianity) propagate non-violence, however, allow to some extent sacrifices in the Name of God. The speciality about Hinduism is that, it is permitted and prohibited according to the way of one’s life. A householder is allowed to kill beings in order to protect himself and lead his life, whereas when a renunciate (‘Sanyasi’) kills even a small living being even if it afflicts pain on him, it is considered a grave sin.
In general, according to our Shastras, it is sin to kill harmless and helpless living beings. They prescribe that by doing so, one would be afflicted with skin diseases in his next birth. It is advisible to do the minimum amount of harm to other beings to lead a peaceful and happy life.