detecting when a button is powered

no clue how to do this sadly <:HuTaoHands:1132376857795362908> but my friend is asking if this is possible, I tried researching and found it is, but not fully sure how

Continue to help post