The enhancement of the spin-orbit torque (SOT) effect through the integration of intrinsic inverse spin galvanic effect spin-orbit torque and spin Hall effect spin-orbit torque is fundamentally dependent on the structural and material properties of the ferromagnets. Consequently, the synthesis of ferromagnets with superior structural integrity and material characteristics is of paramount importance. In this study, a gas-liquid chemical reaction, in conjunction with ultrasonic crushing, was employed to synthesize few-layer MoS2:Er nanosheets. X-ray diffraction, X-ray photoelectron spectroscopy, and energy-dispersive spectroscopy analyses confirm the successful substitution of Mo4+ by Er3+ through doping within the MoS2 lattice. Vibrating sample magnetometry and MT measurements indicate that MoS2:Er exhibits room-temperature ferromagnetism (RTFM), with the underlying mechanism elucidated through first-principles calculations. Furthermore, the unique electron density of states at the Fermi level suggests the presence of ferromagnetism in MoS2:Er. A wedge-shaped Pt/MoS2:Er/Au structure was fabricated and subsequently evaluated for current-induced SOT switching, as well as for its memcapacitor and memristor characteristics. The precession of a magnetic moment in three-dimensional space was successfully simulated by solving the Landau-Lifshitz-Gilbert-Slonczewski equation using the Mumax.