This is a well known indication of a beginner: experienced players apparently never die this way - but I have no idea what they do different or even ideas of what else to try and so I gave up. There was a massive wealth of options (even in the 1990s) and I always wanted to get back into it, but until I come up with a path forward it always feels like I'll never get far so what is the point...
I always played with cheats on just so I could try all the characters and see all their quests and stuff.
Amazing the Ascension speed record is like 49 minutes.
I rushed goblin mines on every character. If I hit a bunch of food in town then the run was on. Store food you can’t carry every few levels. You only need to carry enough food to reach one of your stashes.
You learn good/bad food by watching pet. If your pet wants to eat it then you are good.
I have no idea how people manage vegetarian or foodless runs.
You can mostly trust your pet. But you can't totally trust your pet, because there are some foods that are good for pets but not for @.
One is tripe. I don't get tripe in my pho because NetHack told me it's dog food.
Another is whatever species you are. If you're a human and eat human, or an elf and eat elf, you might get smitten for cannibalism. It's fine for your dog or cat to eat human or elf though.
And there's also the edge case of almost-spoiled food. If your pet eats one of a group of corpses on turn n, and you eat another on turn n+1, it's possible that yours rotted in the meantime. Either because n was the exact limit, or because it was close and yours died a few turns before theirs.