The laws of thermodynamics, despite their wide range of applicability, are known to break down when systems are correlated with their environments. Here, we generalize thermodynamics to physical scenarios which allow presence of correlations, including those where strong correlations are present. We exploit the connection between information and physics, and introduce a consistent redefinition of heat dissipation by systematically accounting for the information flow from system to bath in terms of the conditional entropy. As a consequence, the formula for the Helmholtz free energy is accordingly modified. Such a remedy not only fixes the apparent violations of Landauers erasure principle and the second law due to anomalous heat flows, but also leads to a generally valid reformulation of the laws of thermodynamics. In this information-theoretic approach, correlations between system and environment store work potential. Thus, in this view, the apparent anomalous heat flows are the refrigeration processes driven by such potentials.