District heating distributes heating (or cooling) from sites with an excess to sites with a need. Industrial processes are frequently utilised, though in sufficiently dense construction, office cooling can be a source of heating elsewhere. Many office towers have a net cooling load at all times of year, even under cold ambient conditions.
Seasonal energy storage banks heat from warm periods of year for use in cold periods. This may be completely adequate for general space heat, and sufficient for a large portion of higher-intensity heating (e.g., water). Storage may be in geological structures, if those are sufficiently stable (ground-water migration will also migrate out your stored heat), or constructed energy storage facilities, often little more than well-insulated water tanks with vertical thermal stratification.
Thorstein Chlupp of Rienna LLC designs zero-net-energy homes in Fairbanks, AK, utilising seasonal thermal energy storage. His videos run long, but are exceedingly comprehensive and explain in detail design and construction decisions.
Seasonal storage is covered here beginning at about 1h18m, to about 1h30m:
https://invidio.us/watch?v=AtHkvpRI6fc
https://en.wikipedia.org/wiki/Seasonal_thermal_energy_storag...