In recent years, the increasing demand and rising prices of rare earth elements (REEs), along with their attendant supply risk (about 95% of these elements are supplied by China), have led the European Commission to consider REEs as critical raw materials. Developing and optimizing processes for recovering REEs from secondary sources such as NdFeB magnets is fundamental in this context. A novel method to recover REEs by leaching with citric acid and subsequently separating these elements using the solvent extraction method has been introduced. Therefore, this research investigates the leaching efficiency of REEs, Fe, and B from NdFeB magnets. A full factorial design, with 18 experimental setups, was conducted to optimize the citric acid concentration (1–3 mol/L), leaching time (1–3 h), and solid–liquid ratio (5–10%wt./vol.). All tests were carried out at room temperature and 150 rpm. Different optimizations (response surface methodology (RSM) and artificial neural network (ANN) analysis) are used to maximize the REEs’ leaching efficiency. RSM resulted in a maximum extraction yield of total rare earth elements (TREEs) of about 89% in the investigated experimental plan. This result is similar to that for ANN analysis (about 86%), but more accurate than that for RSM. In fact, for the ANN, an overall R-value higher than 0.99 was obtained. This result indicates that the developed ANN can be used as an accurate model for estimating the leaching efficiencies of REEs from NdFeB magnets.