A microphone is the most common example of a device that turns acoustic (sound) energy into electrical energy. Basically a microphone is a magnet suspended between wires in a way that can react to acoustic vibrations in its surroundings. The magnet vibrates mimicking the acoustic vibrations around it and that generates an electric current in the wires.
The wires then carry the electric energy to an output device e.g. a speaker and the currents make another magnet vibrate in the same way the magnet in the microphone did. This makes the speaker vibrate generating acoustic vibrations that we can hear as sound.