Take the simple example of a sample of gas with a fixed number of molecules. It need not be ideal. Its temperature, T, can be expressed as a function of just two variables, volume, V, and pressure, p. We can, it turns out, express all gas properties as functions of just two variables (such as p and V or p and T). These properties include refractive index, viscosity, internal energy, entropy, enthalpy, the Helmholtz function, the Gibbs function. We call these properties 'functions of state'. The state is determined by the values of just two variables.
Heat and work are not functions of state. They are not properties of the gas. They both represent energy in transit to or from the system, not energy residing in the system.