Drilling operations in deep and ultra-deep wells encounter challenges arising from high temperature and saltwater intrusion, leading to reduced drilling efficiency and deteriorated performance of water-based drilling fluids. In order to alleviate the problem of increased filtration of drilling fluid under harsh environment, the composite (PDDSA-MS) was prepared by free radical polymerization using N, N-dimethyl acrylamide (DMAA), Dimethyl diallyl ammonium chloride (DMDAAC), Sodium styrene sulfonate (SSS), 2-acrylamido-2-methylpropanesulfonic acid (AMPS) and KH570 modified SiO2 as raw materials. This composite contained absorption groups, hydration groups, rigid groups and nanomaterials. Through rigorous performance evaluations, it was observed that the addition of 1 wt% composite to a fresh water drilling fluid, resulting in a remarkably low filtration of 8.8 mL after aging at 260 °C. Furthermore, when 3 wt% composite was added to the 15 wt% NaCl salt water drilling fluid, the filtration was 8 mL after aging at 220 °C. This was attributed to the particle size of the composite and its ability to maintain the dispersion stability of drilling fluid, decelerate bentonite agglomeration, and make the surface of the formed filter cake dense and smooth. These findings demonstrated the thermal stability exhibited by composite, offering an effective solution for drilling operations in deep and ultra-deep wells.