A monotonic stack maintains elements in sorted order (increasing or decreasing). When you push a new element, you pop elements that violate the ordering. This gives you the next greater or next smaller element for each position.
Hard monotonic stack problems combine this with contribution counting, prefix sums, or other techniques. The stack itself is simple. Your challenge is formulating the problem in terms of next greater/smaller elements.