Can heat pumps cool down your home and how do they compare to air conditioning units?

Europe consumes huge amounts of electricity and generates tonnes of CO2 through cooling. Could heat pumps save us during the next heatwave?