In this study, modified biochar (BRB) was prepared from rice straw by ball milling technique and used for the adsorption of methylene blue (MB) in wastewater. The BRB was characterized by SEM, FTIR and XPS, and the adsorption model and Box–Behnken design were used to optimize the five influencing factors. The results showed that the ball milling technique could increase the content of functional groups (–OH, C=C and C–O, etc.) and aromatic structures on the surface of biochar, thus facilitating the removal of MB. The isotherm model was consistent with the Langmuir adsorption model (R2 = 0.947) and the maximum adsorption capacity was 50.27 mg/g. The adsorption kinetics was consistent with the pseudo-second-order kinetic model (R2 = 1) and the adsorption rate was mainly controlled by chemisorption. The thermodynamic model confirmed that the adsorption process was a spontaneous heat absorption reaction. The maximum adsorption efficiency was 99.78% under the optimal conditions (40℃, pH 8, reaction time = 90 min, dosing amount = 0.1 mg), and the adsorption efficiency could be improved by increasing the pH and BRB dosing amount. The surface functional groups and crystal structure properties of BRB were the main determinants of adsorption, and it was clarified that physical adsorption, electrostatic attraction and π-π interaction were the main mechanisms for the adsorption of MB by BRB. The main mechanisms were clarified. Therefore, BRB is an economic, efficient and green adsorption material with good potential for the removal of dye pollutants in the aqueous environment.