Software is easy to debug if you treat it like anything else.
If you have what you think is a bad light bulb, but when you put a new bulb in the socket it doesn't work, you'd conclude the problem was in the socket, not the bulb. (Although it doesn't hurt to try a third bulb from a different pack if possible. Sometimes two bulbs are broken.)
Debugging a problem in software is usually just a series of those kinds of tests.