As a green, economical, convenient and sustainable water treatment technology, solar distillation technology is of great significance to solve global water crisis. The two-dimensional material titanium carbide (Ti
3C
2) is a new type of photothermal nanomaterial with a photothermal conversion efficiency of 100%. In this study, a Ti
3C
2 aerogel with vertical pore structure was designed by directional freeze-drying method, and a solar distillation system based on Ti
3C
2 aerogel was constructed. The system includes a solar absorber (Ti
3C
2 aerogel), a water transporter (acetate cotton swabs), and thermal insulator (polystyrene foam). We examined the photothermal conversion ability and water evaporation rate of the Ti
3C
2 aerogel, and the treatment effect of the corresponding solar distillation system on simulated seawater and methylene blue dye wastewater. The results showed that water evaporation rate of aerogel was as high as 2.73 kg·m
-2·h
-1, solar energy conversion efficiency reached 139.2%, and removal rate of metal ions and methylene blue in water reached more than 99.9%. Therefore, the Ti
3C
2 aerogel has application prospects for seawater desalination and sewage treatment.