The typical thermostat gets placed in line with both the inlet and outlet lines of the cooler.
When the oil is cold, the thermostat sends the oil from the inlet line straight to the outlet line, bypassing the cooler. When the oil is hot, it opens up and sends oil from the inlet line to the cooler, and then out again through the outlet line.
Here's one example:
https://www.summitracing.com/parts/prm-1071
--DD