NetHack/Choosing Role and Race

If you are a beginner, it is much easier to stay alive as a warrior, such as a Barbarian, Valkyrie, or Samurai. These classes are much more likely to survive melee with monsters.

Race is not as significant as class, except that Elves have very low limits on their strength and constitution. An Elf is capped at strength 18, while other races can reach 18/50 or even the maximum 18/**. So, if you want to have an easier game, play as any race that is not an Elf.

Alignment (whether you are lawful, neutral or chaotic) is also not too important; its main effect is on the artifact weapons you can obtain by sacrificing to your deity. (Sacrifice is the process of carrying recently-killed corpses to an altar and -ing them to your god.)

Gender (whether you are male or female) is relatively unimportant; the only real difference is that females can lay eggs if polymorphed into a suitable monster, and males can't. It also has the cosmetic effect of influencing whether incubi or succubi will try to seduce you.

Suggested build
Lawful Human Valkyrie is an excellent combination for several reasons. A Valkyrie starts with a highly enchanted small shield which can remain part of her armour for a long time. She also starts with a good weapon, and if she is lawful, then at experience level 5 (and more certainly by level 7), she can dip that weapon in a fountain to convert it into Excalibur. (The Lady of the Lake does not insist that you are a Knight, but she gets annoyed if neutral or chaotic characters try this trick.) Another weapon, Mjollnir, is their guaranteed first gift from sacrificing, meaning that if your god decides to give you an artifact gift, the first one will be Mjollnir. When the Valkyrie completes the Quest, she will win the Orb of Fate, which halves any damage that she takes, thus making it well worth lugging it around despite its weight. All three artifacts are among the best artifacts in the game.

The advantage of a Human Valkyrie over a Dwarven Valkyrie is that all inhabitants of the Gnomish Mines will be friendly and peaceful to the dwarf but not necessarily to the human. Some see this as a disadvantage, but dwarves and other monsters often found in the Mines are not particularly deadly. Dwarves are a useful source of food, experience and equipment if they are hostile. A Human Valkyrie can kill the dwarves for these benefits, while a Dwarven Valkyrie would have to kill peaceful monsters, and your god does not approve of killing peaceful monsters.

Helpful traits
A few other classes have special features which may help you to learn about the game:
 * Barbarians have poison resistance, meaning that you can eat (almost) anything and learn which corpses are poisonous. Eating a kobold corpse, for example, if it does not kill you, would normally reduce your Strength and take a large number of hit points. A Barbarian, however, will detect the poison, but it will not harm him or her. ("The poison doesn't seem to affect you.")
 * Priests can detect whether items are blessed, uncursed or cursed, which helps with discovering the effect of blessing or cursing items. Note that when playing as a Priest or Priestess, you can assume that any item not marked "blessed" or "cursed" is uncursed.
 * A Priest starts with some potions of holy water;  an object into it to remove the curse or make it blessed.
 * Rangers start with highly enchanted arrows which are very lethal to anything that you shoot with them. Make sure you arm a projectile weapon (such as the bow or crossbow you start off with) and place the +3 arrows or bolts in your quiver.  Fire with T.
 * Wizards start with several magic items - useful for exploring what items exist in the game and what they do. Some Wizards start with junk (a scroll of destroy armor and a potion of sickness would both harm you if you used them) while some start with good items.
 * Some Wizards start with a magic marker - try using it on blank scrolls and blanks spellbooks to write new ones.
 * As well, when a wizard tries to read a spellbook that is too high of a level for them to read it successfully, they will get a warning and opportunity to stop. When other roles try to read a higher level spellbook, they can be both paralyzed and teleported, which will almost always result in your death, if only being nibbled to death by a newt.
 * Healers start with a stethoscope, which is handy for checking the state of health of a monster. (When adjacent to the monster, press A, select your stethoscope, then give the direction of the monster.) Note, though, that Healer is one of the most difficult classes.