No device turns all the energy it is given into the energy you want; some always slips away, usually as heat. Efficiency measures the fraction that does the useful job, and a Sankey diagram draws that split to scale, the useful flow carrying on, the wasted flow peeling away.
Efficiency = useful energy output ÷ total energy input (× 100%). Equivalently, efficiency = useful power output ÷ total power input (× 100%). On a Sankey diagram the width of each arrow is proportional to the energy it carries.
Set the total energy going into a device and how much of it does the useful job. The Sankey diagram redraws to scale: the useful flow carries straight on, the wasted flow peels away as heat, and the two always add back to the input. Efficiency is the useful fraction. Try the real devices to see why a filament lamp wastes most of its energy while an LED keeps nearly all of it, and switch between energy and power to confirm the ratio is the same.
Efficiency is a ratio of two quantities of the same kind. Use useful energy over total energy, or useful power over total power, never an energy divided by a power. Both forms give the same fraction, which has no unit and can be written as a percentage. Mixing the two, or putting wasted energy on top, is the usual slip.
An electric motor is supplied with 500 J of electrical energy and transfers 350 J usefully to the kinetic store of a load. Find its efficiency and the energy wasted.