The total entropy, which is a summation of entropy of the system and entropy of the surrounding, is a determinant for the reversibility.
The sign of total entropy determines if the process is reversible, spontaneous, or not spontaneous but need stimulus. As an exercise, let’s calculate the total entropy, the entropy of the universe for the reversible and irreversible processes.