Switching a relay on & off using a momentary push button

You possible also need contact bounce sorted to make sure you have a nice clean signal to work from.
Search for either hardware or software de-bounce, depending on your choice