How can I survive after genociding my species?
According to the wiki the only way to survive genociding your own race/role is to already be polymorphed into something else and never change back. Nothing else will save you, and if you do change back you will instantly die.
Also note that you cannot polymorph into a creature that has been genocided, so you are going to have to manually kill all of something anyway. It might as well be your own species.
Don't bother. You can't genocide most @
anyway. The game will just tell you that "[y]ou aren't permitted to genocide <monster>" repeatedly for several different classes of monster (it will succeed for a small number of classes including your own).
Genociding h
is an entirely different story, and a good idea for any race other than dwarf (which has to play the polymorph/amulet-of-unchanging game, denying you a perfectly good amulet slot). If you are playing as a dwarf, the usual strategy is to genocide the two mind flayer classes individually (i.e. with uncursed scrolls of genocide). This is a lot cheaper than permanently burning an amulet slot. Note that you must be very careful to spell it correctly: it is "[master] mind flayer," not "[master] mindflayer." The latter might be interpreted as an attempt to genocide "master," which is dangerous if you are playing as a monk.