Need help getting IR sensor to trigger Servo motor

Sorry but i cant get you what do you exactly mean ?
the pseudo code shouldnt include then main ?