And likewise, the Medical Armor/Powerarmor also heals your character as long as you are under 25% health, at the expense of the armor's durability. The healing is automatic after a few turns without taking any damage--it heals you as you move.
The best way to learn when to use medkits is probably just experience. Not your Doomguy's experience level, but your experience with DoomRL. Paying attention to your health is also kinda useful so you know when to heal.
Now I know there are those "cheap" kills when you suddenly die when you were at 50+% health and stuff...well, the game's unfair sometimes. But some of those deaths can often be prevented, and it's another "you'll get it eventually" situations, I'm afraid. Don't reload your elephant gun in the open when you're surrounded by demons. Don't run straight at arachnotrons or captains/commandos and hope you'll have enough health and AC to tank their volleys--it never works that way. Don't stand still in front of Cyberdemon hoping that Cybie's gonna random fire a rocket to the side and try to fake you. Simple things like those. Learning how to dodge and deal with some of the more annoying enemies with safer means can actually save you medkits, as opposed to having a flashing red screen telling you that you have half a backpack full of small medkits and you should probably use a few before you suffer yet another untimely/stupid/sudden death.