GPS Course incorrect (GPS Not locking), how to fix the shown course?

As per title, yes i know the issue is that the GPS not locking properly. So how can i fix the course data? Using the connect app trim form start or end does not help. I have change the distance from 24km to 21.15 km base on my friend Garmin data. If anyone can help me give detail guide or video, it would be very very much appreciated. This was my first ever half marathon, i want to record it properly.