Combination locks in Minecraft can be really simple or frustratingly difficult, but no matter how complicated they are, some of them fall victim to the same simple exploits.
First, I suggest you watch this video, which will explain the whole thing for you. Then I'll go over it again in greater detail with some pictures!
Before we look at breaking them, let's start with how to make them. For this example, I made the simplest combination lock possible, which is known as an OR lock because it's essentially an OR gate.
Essentially, it uses a combination (no pun intended) of normal and inverted power sources to create a "combination". That is, in order to change the state of power, the switches with the torch behind them must be switched on, and the other two must be switched off. Here's a picture:
In this particular case, because I'm using a regular metal door, I inverted the signal with a simple inverter.
Here's what the whole thing looks like from the front:
With this approach, you don't do any lasting damage to their build, and it's akin to using a skeleton key to enter a door.
If the door is unpowered, and requires power to open, all you do is either put a lever next to the door and flip it, or stick a redstone torch on the wall next to it. As the door is now receiving power, it will open!
Yeah, it really is that simple, and you can bypass the locking mechanism entirely.
Sometimes trying to guess a password by manually entering (or writing a program to enter) all possible combinations until you guess the right one is called the "brute force" method.
However, that's slow and obnoxious, and there's an easier way: just breaking the door down.
When in doubt, you can quite literally just break the door. It's not very classy, and it won't win you any points for style, but it's a valid technique.
If you know other ways to bypass locking mechanisms, please let us know!