Look into Vincenty [1] or Karney (for a more robust solution) [2]. Vincenty should be good enough for most use cases.
[1] https://en.wikipedia.org/wiki/Vincenty's_formulae
[2] https://github.com/pbrod/karney