Accurate prediction of the RUL of lithium-ion batteries is critical for ensuring the reliability and safety of battery- powered systems. This paper proposes a hybrid predictive model that combines Long Short-Term Memory Networks (LSTM) with the Firefly Algorithm (LA) for enhanced RUL estimation. The LSTM network captures the complex temporal dependencies in battery degradation data, while the FFA is employed to optimize the model's hyperparameters, improving prediction accuracy and convergence efficiency. Experimental results on benchmark battery datasets demonstrate that the proposed LSTM-FFA model outperforms traditional LSTM and other machine learning approaches in terms of MAE and RMSE. The integration of FFA ensures global search capability and reduces the likelihood of the model being trapped in local minima during hyperparameter tuning. Additionally, the model exhibits strong generalization performance across batteries with different usage profiles, highlighting its adaptability to diverse operational conditions. This approach offers a robust and adaptive solution for battery health prognostics, contributing to improved maintenance scheduling and operational safety in various applications. Future work may involve extending the model to include other metaheuristic optimization algorithms and evaluating performance under real-time embedded system constraints.