To end a trip it is enough to set the correct end date for the trip. The rest will happen automatically.
You can set the end date of a trip in the trip settings:
Where do I find the trip settings
NOTE: In case the Travel Tracker is active, you need to manually turn it off at the end of your trip.