The safety of people’s everyday water consumption has been gravely challenged by wastewater from printing and dyeing, however, research on effective contaminants removal from wastewater is encouraging. In this experiment, attapulgite modified with Mg2+ was calcined, and chitosan was added to create attapulgite composites. By refining the experimental parameters of the preparation, the adsorption performance of rhodamine B in wastewater was enhanced. A fully automated specific surface area and porosity investigation, a method known as X-ray diffraction, and nitrogen adsorption desorption equilibrium temperatures at 77 K were all performed. The original and composite attapulgite samples were evaluated using BET, Fourier transform infrared spectroscopy, and scanning electron microscopy. Composite materials were prepared using n (Mg2+)/m (AP) = 30 mmol/g, m (CS)/m (AP) = 1/3, a calcination temperature of 300 °C, and 1 h. After a series of adsorption experiments, manifesting that adding 0.2 g of attapulgite, at an initial concentration of 800 mg/L, pH of 4, temperature of 25 °C, and stirring for half an hour resulted in a maximum adsorption capacity of 325.73 mg/g. According to thermodynamic and kinetic equations, the pseudo-second-order kinetic theory is more consistent with the Langmuir adsorption isotherm (R2 = 0.999). Upon examining the thermodynamic properties of ΔS, ΔH, and ΔG, it was found that the reaction is a spontaneous endothermic process that could potentially be utilized to eliminate Rh B.