A molecular hydrogen ion HD<sup>+</sup>, composed of a proton, a deuteron, and an electron, has a rich set of rovibrational transitions that can be theoretically calculated and experimentally measured precisely. Currently, the relative accuracy of the rovibrational transition frequencies of the HD<sup>+</sup> molecular ions has reached the order of 10<sup>-12</sup>. By comparing experimental measurements and theoretical calculations of the HD<sup>+</sup> rovibrational spectrum, the precise determination of the proton-electron mass ratio, the testing of QED (quantum electrodynamics) theory, and the exploration of new physics beyond the standard model can be achieved. The HD<sup>+</sup> rovibrational spectrum experiment has achieved the highest accuracy in measuring proton-electron mass ratio, with an accuracy of 20 ppt. This article comprehensively introduces the current state of research on HD<sup>+</sup> rovibrational spectroscopy, detailing the experimental method of the high-precision rovibrational spectroscopic measurement based on the sympathetic cooling of HD<sup>+</sup> ions by laser-cooled Be<sup>+</sup> ions. In section 2, the generation and trapping technique of both Be<sup>+</sup> and HD<sup>+</sup> ions are introduced. Three ion generation methods including electron impact, laser ablation and photoionization are also compared in this section. In section 3, we show the successful control of the kinetic energy of HD<sup>+</sup> molecular ions through the sympathetic cooling, and the importance of laser frequency stabilization for sympathetic cooling of HD<sup>+</sup> molecular ions. In section 4, two methods for preparing internal states of HD<sup>+</sup> molecular ions, optical pumping and resonance enhanced threshold photoionization, are introduced. Both methods show the significant increase of population on the ground rovibrational state. In section 5, we introduce two methods for determining the number changes of HD<sup>+</sup> molecular ions: secular excitation and molecular dynamic simulation. Both methods combined with resonance enhanced multiphoton dissociation can detect the rovibrational transitions of HD<sup>+</sup> molecular ions. In section 6, the experimental setup and process for the rovibrational spectrum of HD<sup>+</sup> molecular ions are given and the up-to-date results are shown. Finally, the paper is concluded with the summary of the techniques used in HD<sup>+</sup> rovibrational spectroscopic measurements, the prospects of potential spectroscopic technologies for further improving frequency measurement precision, and the development of spectroscopic methods of different isotopic hydrogen molecular ions.