How do I check on contacts and sensors

There are several ways to do this, but at this point, the most straightforward will be to use core because you have stacked conditionals. ( this is a clickable link)