For more complicated systems with more particles and more forms of energy, we can extend the definition from Work Done on a System By External Forces:
Where
For example, a bouncing tennis ball has deformations and bending in the system as the ball hits the floor, increasing its internal energy while decreasing some kinetic energy, so the ball won’t bounce back as high.