There are 2 portions to this; the conversion of addresses into coordinates and then calculating the distance between coordinate sets.
The conversion of addresses to coordinates is called
Geocoding, and this is where Google comes in; as they have an API. There is plenty of existing documentation on this; here's the crux of what you need to know:
Get Started | Geocoding API | Google Developers[
^]
The second portion is determining the distance between the points; and where all them algebra, geometry, and trigonometry skills you forgot get relearned.
For the greatest precision especially when longer distances are involved, you will want to use the
Haversine formula - Wikipedia[
^]
If absolute precision is not required and you are within 100 km or so, you could implement some simpler math to get the differences in latitude and longitude, and then pump this through the Pythagorean Theorem to get a pretty good distance estimate
Last portion is conversions between (decimal) degrees and kilometers, which can be helpful
How big is a degree of Latitude Longitude[
^]