In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.
Note how the last closing brace is not on the left margin. That usually indicates that you do not have matched pairs of opening and closing braces in the sketch
pinMode is used for gpio pins not on a lcd screen..
move the lcd.begin up into setup replacing the pinMode on the lcd..
this will initialize the lcd and get it ready..
delete that last void loop{ line, not sure what that is about..