All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallahu ‘alayhi wa sallam, is His slave and Messenger.
There is no harm in killing mosquitoes and similar harmful creatures during the prayer, and it does not affect the validity of the prayer, because it involves slight, insignificant movements, which is pardoned in the prayer.
As for the blood spreading over your body or clothes due to the mosquito bites or as a result of killing it, this is an insignificant impurity that is pardoned as well.
Allah knows best.