It helps if you consider the first and second law expressed in terms of energy and entropy densities that depend explicitly on space and time, rather than differentials.
The first laws is:
$$\frac{\partial e}{\partial t} + \nabla\cdot(e\boldsymbol{v})
= \boldsymbol{T}:\nabla\boldsymbol{v}+\nabla\cdot\boldsymbol{q} - Q,$$
where $e$ is the energy density; $\boldsymbol{v}$ the velocity of the fluid or material; $\boldsymbol{T}$ is the stress, e.g. the pressure or viscosity in a fluid; $\boldsymbol{q}$ is the surface flux of heat, and $Q$ is the volume sink of heat. The term $\boldsymbol{T}:\nabla\boldsymbol{v}$ represent the work being done on the fluid or material, and reduces to $p\partial V/\partial t$ in the case of a fluid with no viscosity. If you integrate this equation over a control volume you get a formula that says, in words,
$$\frac{\mathrm{d}(\text{total internal energy within volume})}{\mathrm{d}t} + (\text{flux of energy through volume boundary}) = \text{power} + \text{heating}.$$
The "power" is the work done per unit time, and the "heating" is the heat transferred per unit time. The flux of energy through the boundary appears if the system is open, so matter that moves through the boundary is carrying its internal energy in or out.
The second law has a similar expression:
$$\frac{\partial s}{\partial t} + \nabla\cdot(s\boldsymbol{v})
\geqslant \nabla\cdot\left(\frac{\boldsymbol{q}}{T}\right) - \frac{Q}{T},$$
where $s$ is the entropy density and $T$ the temperature. Again, if you integrate over a control volume you obtain
$$\frac{\mathrm{d}(\text{total entropy within volume})}{\mathrm{d}t} + (\text{flux of entropy through volume boundary}) \geqslant \frac{\text{heating}}{\text{temperature}}.$$
The flux of entropy through the boundary appears if the system is open, so matter that moves through the boundary is carrying its entropy in or out.
I'm sorry if this looks complicated, but if you devote some time to it, even skipping the technical details, it can give you a better grasp of what the first and second laws say and how to use them in unfamiliar situations.
Check out C. A. Truesdell: Rational Thermodynamics (2nd ed., Springer 1984), or I. Samohýl & M. Pekař: The Thermodynamics of Linear Fluids and Fluid Mixtures (Springer 2014).