To extract work from heat, thus producing a perpetual motion machine of the second kind, the most common approach (dating back at least to Maxwell's demon) is "unidirectionality".
Loosely based on the concept of Maxwell's demon, the object is to separate red and blue molecules into their respective color-coded chambers, using a sliding door.
This experiment, known as Maxwell's demon, consists of a hypothetical demon that guards a trapdoor between two containers filled with gases at equal temperatures.
In these terms, it would be by thermodynamic operations that, if he could exist, Maxwell's demon would conduct unnatural affairs, which include transitions in the sense away from thermodynamic equilibrium.