Through a series of pumps and electricity, from the USGS Water Science School:
Let’s assume that you get your water from the local water department through pipes buried below the streets. In other words, you don’t have your own well in your back yard. Chances are that you get your water through gravity and pumps. Cities and towns build those big water towers on top of the highest hills and then fill them with water. So even if you live on a hill, there’s a good chance the water tower is higher than your house. Water moves from the tower, due to gravity, and goes down a large pipe from the tower to eventually reach your house.
Although gravity supplies the power to move water from the tower to homes, electricity is needed to run a pump to push water from the source.
In my city, those water pumps use a lot of electricity. It is the second largest city expense, using 5.4 million kWh and costing more than $500K a year. (Energy Action Plan, page 21)