In my opinion, this is basically practicing four Jhana by gradual training. For instance, a person who likes killing stops his habits gradually. Say stop killing humans, then animal then fish then insects, etc. Another example is substituting angry thoughts with lovingkindness thoughts.
==============
iv “If, while he is trying to forget those thoughts and is not giving attention to them, there still arise in him evil unwholesome thoughts connected with desire, with hate, and with delusion, then he should give attention to stilling the thought-formation of those thoughts. When he gives attention to stilling the thought-formation of those thoughts, then any evil unwholesome thoughts connected with desire, with hate, and with delusion are abandoned in him and subside. With the abandoning of them his mind becomes steadied internally, quieted, brought to singleness, and concentrated. Just as a man walking fast might consider: ‘Why am I walking fast? What if I walk slowly?’ and he would walk slowly; then he might consider: ‘Why am I walking slowly? What if I stand?’ and he would stand; then he might consider: ‘Why am I standing? What if I sit?’ and he would sit; then he might consider: ‘Why am I sitting? What if I lie down?’ and he would lie down. By doing so he would substitute for each grosser posture one that was subtler. So too…when a bhikkhu gives attention to stilling the thought-formation of those thoughts…his mind becomes steadied internally, quieted, brought to singleness, and concentrated.
https://suttacentral.net/mn20/en/bodhi