Phase change materials (PCMs) are functional energy-storage materials that achieve reversible heat storage and release through phase transition processes. They have extensive applications in the thermal management and solar energy industries. However, their low electrical and thermal conductivities and poor stability often fail to meet application requirements. In this study, we utilised an abundant biomass-derived carbon source, sweet potatoes, to prepare a three-dimensional network of carbon aerogels. By simply vacuum-impregnating polyethylene glycol (PEG), the PCM was embedded in the carbon aerogel. The obtained PEG/carbon aerogel composite material exhibited high enthalpy (158.1 J/g) and good thermal and shape stability. They also demonstrated efficient photothermal (88.47 %) and electrothermal conversion (94.02 %). This research has significant potential for applications in solar energy storage and utilisation, building energy storage, space–ground thermal energy storage, and electronic device thermal management. This study provides a novel approach for the preparation and photothermal applications of bio-based PCMs.