Electronic cooling in Weyl and Dirac semimetals