Detachment means standing back with part of the consciousness and observing what is being done without being involved in it. There is no “how” to that; you do it or try it until it succeeds.
Ref: Letters on Yoga – III