Four-speed manual transmissions are largely outdated, with five- and six-speed transmissions taking their place as the more common options. Some performance cars may offer even more gears. However, they all work more or less the same, regardless of the number of gears. Internally, it looks something like this:
There are three forks controlled by three rods that are engaged by the shift lever. Looking at the shift rods from the top, they look like this in reverse, first and second gear:
Keep in mind that the shift lever has a rotation point in the middle. When you push the knob forward to engage first gear, you are actually pulling the rod and fork for first gear back.
You can see that as you move the shifter left and right you are engaging different forks (and therefore different collars). Moving the knob forward and backward moves the collar to engage one of the gears.
Reverse gear is handled by a small idler gear (purple). At all times, the blue reverse gear in this diagram above is turning in a direction opposite to all of the other blue gears. Therefore, it would be impossible to throw the transmission into reverse while the car is moving forward; the dog teeth would never engage. However, they will make a lot of noise.
Manual transmissions in modern passenger cars use synchronizers, or synchros, to eliminate the need for double-clutching. A synchro's purpose is to allow the collar and the gear to make frictional contact before the dog teeth make contact. This lets the collar and the gear synchronize their speeds before the teeth need to engage, like this:
The cone on the blue gear fits into the cone-shaped area in the collar, and friction between the cone and the collar synchronize the collar and the gear. The outer portion of the collar then slides so that the dog teeth can engage the gear.
Every manufacturer implements transmissions and synchros in different ways, but this is the general idea.