This is a very old skill called troubleshooting, where you look at the signals in, signals out, and try to figure out what could cause what you are seeing.
Op amps and digital are usually pretty easy, since the results are not ambiguous. It is always possible something connected to the output pin is dragging it around, you just have to look and see, and sometimes remove other components to eliminate possibilities.