A significant environmental concern is posed by wastewater containing dyes. When dealing with a polluted medium, adsorption is a beneficial method for the removal of contaminants. This study used argan nutshell as a precursor to synthesize activated carbon via chemical activation with Na2CO3 at 600 °C. The prepared activated carbon (Na@Ac) was characterized using Fourier-transform infrared spectroscopy (FTIR), scanning electron microscopy (SEM), Brunauer–Emmett–Teller (BET), and zeta potential measurements. The results showed that the prepared activated carbon has a high surface area (1543 m2/g) and microporous structure. Furthermore, many parameters for Rhodamine B (RhB) dye removal efficiency, including pH, initial pollutant concentration, and temperature, were optimized by response surface methodology (RSM) with a central composite design. Based on the RSM, the best efficiency was 96.84% for the removal of RhB at pH 5, temperature 20 °C, and initial concentration 33.2 mg/L. The kinetic of RhB dye adsorption onto Na@Ac was effectively explained by a pseudo-second-order model, with a maximum uptake capacity of 35.9 mg/g. Moreover, Density functional theory (DFT) calculations were used to understand the adsorption mechanism of the RhB dye onto the Na@Ac. Based on the DFT calculations, hydrogen bonding and π-π interactions may be preferred mechanisms of RhB dye adsorption onto Na@Ac. The Na@Ac could be a promising adsorbent for the removal of Rhodamine B from polluted wastewater.