The Dst index is the geomagnetic storm index used to measure the energy level of geomagnetic storms, and the prediction of this index is of great significance for geomagnetic storm studies and solar activities. In contrast to traditional numerical modeling techniques, machine learning, which emerged decades ago based on rapidly developing computer hardware and software and artificial intelligence methods, has been unprecedentedly developed in geophysics, especially solar–terrestrial space physics. This study uses two machine learning models, the LSTM (Long-Short Time Memory, LSTM) and EMD-LSTM models (Empirical Mode Decomposition, EMD), to model and predict the Dst index. By building the Dst index data series from 2018 to 2023, two models were built to fit and predict the data. Firstly, we evaluated the influences of the learning rate and the amount of training data on the prediction accuracy of the LSTM model, and finally, 10−3 was thought to be the optimal learning rate. Secondly, the two models were used to predict the Dst index in the solar active and quiet periods, respectively, and the RMSE (Root Mean Square Error) of the LSTM model in the active period was 7.34 nT and the CC (correlation coefficient) was 0.96, and those of the quiet period were 2.64 nT and 0.97. The RMSE and CC of the EMD-LSTM model were 8.87 nT and 0.93 in the active period and 3.29 nT and 0.95 in the quiet period. Finally, the prediction accuracy of the LSTM model in the short time period was slightly better than the EMD-LSTM model. However, there will be a problem of prediction lag, which the EMD-LSTM model can solve and better predict the geomagnetic storm.