Risk in dungeon crawl is something you'll have to learn to evaluate :
What is a no risk situation, what is a a minor risk or what is a major risk, and what's just impossible.
No risk can be on D:3 your level 3 human fighter run into a rat, the rat isn't going to have any hope to hurt you and you're probably going to one shot it.
Minor risk , on D:3 you run into a single Orc with your level 3 human fighter, your character should be able to dispatch that Orc, but his weapon could be good enough to hurt you if you're not lucky with how the game generated that Orc.
But what's important to keep in mind is that Orc are sometime not walking alone, and behind it in that unexplored part, there could be an Orc Priest just waiting to see you and smite you to death from afar.
If there's a priest, the minor risk become a major risk of your character going to die : if there's an orc priest just run away.
Major risk, on D:3 you run into an Ogre with your level 3 human fighter , if you decide to fight, from there 2 thing will happen : you win or you get crushed.
The thing is that in situation, if you still insist to fight, it's a major risk because you winning at that point will require a -huge lot- of luck, the Ogre instead is more likely going to hit your level 3 human fighter 2 times in a row without a problem and it's game over due to how high damaging Ogre are at that point.
Now if you win, you're nearly 100% sure to gain a level and gain a level for a couple of your skills, but you have so few chances of winning that it's not worth losing a character.
The best option is : run away.
But if by chance before running into that Ogre you had found some blowtube with poison needle, or some good wand of Fire or Cold (not to be confused with a wand of Flame or Frost that only shoot weak), suddenly the major risk is relegated to minor one : you can actually kill that Ogre with only minor chances of things going bad. Just avoid having that Ogre getting close to you. Because Ogre in melee is still major risk, even if he's poisoned or you can zap him.
Then you have the impossible situation, on D:3 your level 3 human run into Sigmund, you didn't had the luck to find someg ood wand/poision, at that point don't even try to have illusions of winning, Sigmund will turn invisible, will confuse/paralyse your character and will destroy you in no time.
Only solution when facing impossible odd in Crawl : run away, don't try to play heroics, remember Crawl isn't about heroics, it's about running away.
Cowardly characters are the ones that can win at Crawl, heroic characters are the one that die early.