As you build more complicated projects you need get better at troubleshooting.
Below you will find the code to print to serial monitor.
Step 1: You need to set the baud rate in the setup loop.
Serial.begin(9600);
Step 2: You need to print the information or variable that you would like to observe, to the Serial monitor
Serial.println(variableName);
You will notice we have used both these instructions before:
Serial.print() This does NOT make a line carriage after the instruction
and
Serial.println() This makes a line carriage after the instruction, so the next time it runs it will print on a new line, sometimes making it easier to read data. It is very difficult to analyse this kind out of output ONONONONONOFFOFFOFFOFFOFFONONONOFFOFF