How can i calculate distance km between two latitude and longitude points?

So the title is all i want, on how to calculate distance between two latitude and longitude,
please give me an example script.

you need the Haversine formula.

Thanks but i dont understand it

This is unfortunate. There are code examples you can copy at the bottom of that page.