How do I program my toggle switch to Arduino leonardo?

There is a tutorial on this site for using switches and other items as inputs, written by Perry - have a look for it , it gives you the answers you’ll need and sample code