aleykum selam
i found an info,i had some infos but i searched it one again,it says that you should not kill any living creature on purpose untill you ensure it can injury you,like snakes,scorpions,that time you can kill,but u know an animal never injury human or it' attacks (if defences itself,not aim to attact) but u know it can't affect you then work to throw away it,that says if you have a gun and you see a dangerous animal;before shoot it try to keep away urself but you noticed it follows you then u can kill it,but its sin to kill harmless animals exactly (like ant,home spiders etc,there are many)
pray tonight and apologize inshAllah Allah (c.c) will forgive you,this is not a deadly sin.