Read the book on the if statement.
... don't just let your eyes go over the words! Try and figure out what is going on. If you are reading code, then you have got to enter the code. Make sure to type the code into a computer and compile and run it. Make sure you understand it.
And when you get the code working, try variations on the code. Change it around to do something else. If you really understand how it works, then you will be able to use the code in your own programs.