An electromagnetic wave is produced when a charged particle undergoes acceleration. This acceleration causes the particle to generate time-varying electric and magnetic fields, which propagate through space. The electric field oscillates perpendicular to the direction of wave propagation, and the magnetic field oscillates perpendicular to both the electric field and the direction of wave propagation. This results in the formation of an electromagnetic wave, which can travel through a vacuum.