If you have a system boundary, energy as either heat or work can cross the boundary to change the state of the system. You have to be able to distinguish which is which for thermodynamics.
Consider the following cases for a tank of fluid such as water, where for each case the temperature of the water increases by the same amount from T1 to T2.
1a. A resistor of an electrical circuit is outside the system boundary and is at a higher temperature than the fluid and transfers heat Q.
1b. The resistor is inside the system boundary and transfers the same Q as before.
2a. A paddle wheel connected to a shaft is inside the system boundary and the shaft work is W.
2b. A paddle wheel and its ideal motor is inside the system boundary, and spins as before with the same voltage V and amperage I for the same amount of time t.
1a is evidently heat transfer and 2a is evidently work transfer.
What about 1b and 2b? Can you yourself state whether that is work or heat crossing the boundary?
All 4 tanks are having their delta U increase by the same amount with energy crossing the boundary as either heat or work, and you can see sometimes the placement of the system boundary will determine whether you can call the energy transfer as either heat, or work. What if instead of the paddle wheel, we replaced it with friction pad? and included the friction pad either inside, or outside the system boundary? Heat? or Work?
In neither of the cases did deformation take place. And none of the work was a product of pressure and volume changes ( which is to some degree a work W = force F times distance x type of calculation and easy to spot ). At other times the electrical, mechanical, magnetic, gravitational,... work can be difficult to see.
Changes in KE and PE are not considered for changes in U, but are part of the overall energy E of the system from E1 to E2, although some exceptions probably do apply.