I can figure out what is wrong with this simple sketch

You should study the blink sketch and then read up on the purpose of each of the function in it.
All is explained here:
https://docs.arduino.cc/language-reference/