Both Macbooks and PC computers can connect to an external monitor or projector by Mirroring the display (both screens show the same thing) or extending the display (each screen shows a separate, independent screen). There are shortcuts for both Mac and PC to change between the two.
Hold down the Command button (⌘) and hit F1 (upper left corner of the keyboard next to the esc key). This will automatically switch between mirrored and extended displays if you are connected to an external display.
When you mirror you may notice black bars on the sides or top of one of the displays (built in or monitor/projector). This is because they are sized differently and you can choose which you want to look 'right'.
Start by going to the Displays section in system preferences (can use spotlight by hitting command and spacebar and typing 'displays' into the search). In the Display tab there is a drop down for 'Optimize for' and you can choose Display (typically the monitor or projector) or Built in Display (your computer).
If the display looks odd, you can also play around with Scaled and the resolutions vs. Best for Display. These settings should be saved for every time you connect to the same monitor.
On a PC (Windows) computer, hold down the windows button and hit P. You will see the following image;
Continuing to hit P will allow you to select the different options.
Controlling your projector from your MacBook
For most teachers, using the remote is the most efficient way to control the classroom projector. If you require the ability to control the projector from your MacBook, directions to set up this feature are linked here.
Note: If you travel between rooms, the unique IP address you use in the initial setup will only control that classroom computer. Thus, you would need to replace the IP address for the various rooms each time you change to a new location.