It is usually said that the best formulation of the first law of thermodynamics is that work is path independent on adiabatic paths. From there, you can define the state function of internal energy and define heat as the deficit between internal energy and work. However, to define an adiabatic path you already need a definition of heat so how do we define an adiabat properly in this formulation?
The solution of this apparent conundrum is quite simple. Even without any knowledge about heat, a thermodynamic system has confining walls between system and outside world. Simply by playing with the walls, by changing the material they are made of end their size, one can find that with some materials, the work required to bring the system from a state $A$ to a state $B$ depends less and less on the exact path in thermodynamic space. Those walls can be defined adiabat (made by thermal insulators) and the transformation is called adiabatic. At this point the usual definition of heat from the adiabatic work can follow in a logically consistent way.