An If statement is composed of three parts. The first part should be keyword w.r.t language to convey to the computer that it is if statement. And a Boolean expression. The second and thirds part can be a statement or group of statements as defined in rules of grammar of language. Generally, an if statement is evaluated and executed in the following sequence: first it evaluates the boolean expression. If the expression is true, the statements in the second part are executed.
Otherwise if it is false, the statements in the third part are executed. The third part is optional; if it is absent and the expression is false, then the program control simply moves on to the next statement in the sequence.