Waste heat is the part of the heat input that must be rejected rather than converted to useful work.
Not all heat becomes work
The heat input is 30 joules, but useful work is only 12 joules.
Qin=30 JWout=12 J
Find the waste heat
Waste heat is the input heat minus the useful work.
Qwaste=Qin−Wout
Compute the rejected heat
Subtract 12 joules from 30 joules. The waste heat is 18 joules.
Qwaste=30 J−12 J=18 J