A bridge rectifier, made from four diodes, in front of an oscilloscope display showing what it does. An alternating current (AC) signal is being fed into it via the black and white wires, and is displayed on the upper trace of the oscilloscope. The ticked line on the oscilloscope grid, over the upper trace, indicates the zero-volt point.
The lower trace shows the direct current (DC) signal coming out of the bridge rectifier, via the red and green wires. The line at the bottom of the waveform shown on that trace, is the zero-volt point.
A diode lets current flow in only one direction. A bridge rectifier has the four diodes arranged so that whichever side of the AC signal is positive will only flow through the diode that is pointed toward the positive DC output, while whichever side is negative, will only flow through diode pointing toward the negative DC output. As the AC signal switches direction, which diodes it flows through switch accordingly.
Note that the output frequency of the DC signal is twice that of the AC signal, and is at zero at the same time that the AC signal is at zero, and goes positive as the AC signal goes either positive or negative.
If you were going to use this as a power supply, you’d probably want to put a big capacitor on the output of the bridge, to smooth out the ripple, and possibly a voltage regulator after that.