When should this come to mind?
The most recent unfinished task must be resolved first.
Nested matchingLast-in-first-outPrevious greater or smallerUndo
What makes it work
Push and pop from the same end; always handle an empty stack.
When to choose something else
Processing in arrival order calls for a queue.