A general minimization method for unsmooth extremal problems