Wiring question

Hi, I am new to connected. Having some issues and have a question. All of my sensors appear to have 4 wires like this picture. (Red, black, yellow and green) I have one connected like picture for a door sensor which works. Then I connected my second door sensor the same way but it is stuck in what appears to be the open position. Hoping somebody can help guide me. Thanks!

Bizarre if they ran 4 wire to each door.  Typically door and window sensors are 2 wire and detect a closed loop.  If you have a DMM, try connectivity between each.  When the door is closed and you have continuity, those are the two to connect to the konnected.