The if statement in coding is used for logic and sequential state machine control. Basically it helps the application decide what to do next based on a set of values that need to correspond to the logic flow requirement.
a = 1
if a==1 then
print ("a is one")
end