You just need to have the cameras open at all and she'll go on cooldown (if this works just like fnaf 1, which seems to be the case)
And for freddy, if your camera is pointed at that last location on the right, freddy can't move, even if your cameras are down (that's called the "Camera Stall", or just "Camstall". It's an oversight of Scott when he made FNAF 1, but has been canonized and used everywhere)
To respond to your other response, if we assume everyone works exactly the same, bonnie will just randomly pick spots in her path, so you're mainly just looking to catch her on the lights (there's a sound cue when bonnie or chica reach the doors). Bonnie's a lot trickier since you can't see her on lights if the door is closed, so you'll mainly want to just check the cams to see if you spot her, unless you want to risk the timing on flicking the door open to flash her