Energy Dissipation at the Nanoscale: from graphene to phase-change materials