How do you receive a on or off digital input. I do not know
how to make a digital input into boolean so that it only runs the
program when the input is ON.
Here's a slightly modified version of the shipping example called Read Dig Chan. Instead of returning a Boolean array of the status of all lines in a port, it returns a Boolean of a single line.
But your program will always be running, if nothing else, polling to see if the Digital line is high. Maybe this was your intention from the beginning, but it is not clear, at least to me.