Do you have two computers but just one monitor? That's not a problem--even if the computers are Macs and PCs. Monitors--for the most part--are platform-independent, so all that matters is that the type of input cable is correct. If your monitor has two monitor input ports, all you need is two cables that match. If your monitor has just one input port, you'll need a KVM switch.
Check your monitor for input ports. If it has a VGA and a DVI input port, your task is easy. Your PC likely has a VGA output; connect one end of the cable to that and the other end to the port on the monitor. If your MAC has a DVI output port, connect one end of the DVI cable to the Mac and the other end to the monitor. Use the "input type" button on the monitor to switch back and forth between the PC (analogue) and Mac (digital) displays.
If your Mac has a mini DVI input (common on some Macbooks and Minis), you'll need to connect the cable to it through a mini DVI-to-DVI adaptor.
If your monitor has only one input port, you'll need to follow steps using a KVM (which stands for keyboard, video, mouse) switch.
Connect the KVM switch to your monitor using a VGA cable. Different brands will vary, but usually there will be an indicator as to where the monitor input cable goes.
Connect one of the output VGA cables to your PC. Connect the other to your Mac. Depending on the type of video output port on your Mac, you may need an adaptor to connect the VGA cable from the KVM switch.
Turn on both computers, and use the buttons on the KVM switch to alternate between displays.
If using a KVM switch, sometimes the screen resolution will need to be adjusted when switching back and forth. This can usually be avoided by switching to the screen you wish to use before powering up the computer. KVM switches have speaker and USB ports to allow for sharing a keyboard and mouse, too. However, it is not necessary to use these if you are using separate keyboards and mice.