Early submarines used a direct mechanical connection between the engine and propeller, switching between diesel engines for surface running, and battery-driven electric motors for submerged propulsion.
In 1928, the United States Navy's Bureau of Engineering proposed a diesel-electric transmission. Instead of driving the propeller directly while running on the surface, the submarine's diesel drove a generator that could either charge the submarine's batteries or drive the electric motor. This made electric motor speed independent of diesel engine speed, so the diesel could run at an optimum and non-critical speed. One or more diesel engines could be shut down for maintenance while the submarine continued to run on the remaining engine or battery power. The US pioneered this concept in 1929, in the S-class submarines S-3, S-6, and S-7. The first production submarines with this system were the Porpoise class of the 1930s, and it was used on most subsequent US diesel submarines through the 1960s. No other navy adopted the system before 1945, apart from the Royal Navy's U-class submarines, though some submarines of the Imperial Japanese Navy used separate diesel generators for low speed running.
Air-Independent (More on Wiki HERE)
During World War II, German Type XXI submarines (also known as "Elektroboote") were the first submarines designed to operate submerged for extended periods. Initially they were to carry hydrogen peroxide for long-term, fast air-independent propulsion, but were ultimately built with very large batteries instead. At the end of the War, the British and Soviets experimented with hydrogen peroxide/kerosene (paraffin) engines that could run surfaced and submerged. The results were not encouraging. Though the Soviet Union deployed a class of submarines with this engine type (codenamed Quebec by NATO), they were considered unsuccessful.
Nuclear (More on Wiki HERE)
Steam power was resurrected in the 1950s with a nuclear-powered steam turbine driving a generator. By eliminating the need for atmospheric oxygen, the time that a submarine could remain submerged was limited only by its food stores, as breathing air was recycled and fresh water distilled from seawater. More importantly, a nuclear submarine has unlimited range at top speed. This allows it to travel from its operating base to the combat zone in a much shorter time and makes it a far more difficult target for most anti-submarine weapons. Nuclear-powered submarines have a relatively small battery and diesel engine/generator powerplant for emergency use if the reactors must be shut down.
Magnetohydrodynamic (More on Wiki HERE)
A magnetohydrodynamic drive or MHD accelerator is a method for propelling vehicles using only electric and magnetic fields with no moving parts, accelerating an electrically conductive propellant (liquid or gas) with magnetohydrodynamics. The fluid is directed to the rear and as a reaction, the vehicle accelerates forward.