Bonnie will knock on the door to your right (when facing the window) three times, and then enter the room.
Freddy will not attack you while you are dealing with Bonnie or Foxy.
You can have the light on while dealing with Freddy. You must then close the curtains until you hear a robotic moan, after which you can open them again. He will start off by lurking at the side of the window, making a thud sound. If enough sanity is drained after the light turns red, you will die. As sanity decreases, the light's color will change from green to yellow, then to orange and finally red. You can check how much sanity you have left by looking at the blinking light to the left of Bonnie's door. Decreased sanity will result in the screen turning gray, shaking and hallucinations. Sanity will drain gradually through the night, but will drain faster by looking at animatronics or sleeping, and will drain slower by looking at the lamp while it's on.