In my Godot project, I use the navigation agent 3D so the monsters can move avoiding objects and walls automatically, and use the built-in algorithm to find the shortest route to the target. If you like to make the monsters move like in the classic doom, then you should do it manually.
In Doom, the monster checks where its target is, and chooses a new direction to move out of 8 possible directions (i.e. monsters never walk by arbitrary lines, only horizontal, vertical, or diagonal movements are allowed).
Then checks if new direction doesn't require 180 degrees turn (because such turning is forbidden). if new direction doesn't require a turn, checks if can move in that new dir (i.e. simulates a step). if movement is allowed, we're done.
Now, if the monster cannot move into new direction (or new direction requires a 180-turn), then there is a chance (roughly 70%) for monster to turn left or right (by random, and again, with movement checking).
If all new pathes are blocked, the monster finally tries to turn around -- this is the only case when it does 180 degree turn. that's why monsters "run away" from the player in narrow corridors -- they simply cannot turn around.
This is basically it. no complex logic or pathfinding, so-called AI is quite dumb. the illusion of more-or-less smart movement comes from map design, and from the feature of human brains to see patterts of smart behavior everywhere. ;-)