Is it possible to make the pointer "stick" to one display when using multiple displays? I use multiple displays, and often find the mouse pointer moving to the other display when going to the scroll bar or pressing the close button on an application, for example.

Is it possible to make the mouse "stick" to one display? To see what I mean, you could try to slowly drag a window to a side of your display. It will stop when the edge of the window touches the edge of the display for a little while, unless you push it further. I essentially want this behavior for my mouse pointer.

I found something similar to this for Windows, but unfortunately that's for Windows, not macOS where I need it!
Try EdgeCase for US$14.99 from the MAS.  It has 4.5/5.0 stars with 53 reviews.  It should 'lock' your mouse to 1 display.  It might not be an exact duplicate of the one you found for Windows, though.
The application description states:

The app prevents you from ever accidentally losing your cursor into a rarely-used secondary display, or from overshooting as you flick to an OS X hotcorner or the menu bar.  EdgeCase prevents your mouse from moving between multiple monitors by putting a temporary barrier between the edges of your screens.
When you do want to switch to another screen, EdgeCase provides several shortcuts that allow you to cross screen edges manually. Simply perform a 'bounce' gesture, wait for ½ second, or hold a hotkey. Your cursor will then move into the next screen freely.