Text this: Energy removal in dynamical systems through an optimal sequence of constraint application