One way, by thresholding, is shown in my Image Segmentation Tutorial in My File Exchange.
There are lots of other ways. Usually you might need to do some sort of preprocessing, for example texture detection or motion detection or color detection, until you can get down to some kind of image that can be thresholded. But, in the end, once all's said and done, it usually comes down to thresholding. Even Deep Learning has thresholding internal to it though it's inside the black box and not visible to you.