A multiscale method for computing the effective behavior of a class of stiff and highly oscillatory ordinary differential equations (ODEs) is presented. The oscillations may be in resonance with one another and thereby generate hidden slow dynamics. The proposed method relies on correctly tracking a set of slow variables whose dynamics is closed up to e perturbation, and is sufficient to approximate any variable and functional that are slow under the dynamics of the ODE. This set of variables is detected numerically as a preprocessing step in the numerical methods. Error and complexity estimates are obtained. The advantages of the method is demonstrated with a few examples, including a commonly studied problem of Fermi, Pasta, and Ulam.