Copy the above code and open with Arduino IDE.
Click Upload button on Arduino IDE to upload code to Arduino.
Open Serial Monitor.
Select baurate 9600 and newline option.
Type “ON” or “OFF” and click Send button.
See the built-in LED's state on Arduino board.
We also see LED's state on Serial Monitor