With underground pipes carrying warm water and returning colder water to the plant [0]. This is agnostic to the heat source, small leaks are not polluting or dangerous, and large leaks don’t explode.
IMO the real problems with district heating are a lack of large-scale standardization (you can’t go to your local HVAC installer and ask for an off-the-shelf heater to pair with a district heating system) and that heat pumps are good enough and cheap enough that they erase some of the benefit.
That being said, a district heating system can inexpensively store heat for later use, whereas electric systems cannot easily do this. (Gas can be stored inexpensively on a large scale, too, which I think is really the major remaining current benefit of natural gas over electricity.)
I can imagine a modern system for a cold-but-mostly-sunny climate: a big PV (and optionally wind) installation produces electricity. When electricity is cheap (sunny / windy conditions), heat pumps heat a thermal reservoir sized to hold a few weeks of heat (this could be a large container of water or even just a bunch of earth insulated on the sides). During cold conditions with less power, heat from the reservoir is used for district heat.
I don’t know whether this would be economical compared to batteries, pumped hydro, gas peaking plants, etc.
[0] District heating with steam is a thing, but it requires higher temperatures, which is not so great if the heat source is a heat pump or waste heat from a lowish-temperature process. It’s not even great if the source is a dedicated boiler, since more energy is available from the same amount of fuel if the flue gas can be cooled below its condensation temperature. (Old systems did not do that, since the materials they were made of would be rapidly corroded by condensate.)