How to know if our copter has reached destination in guided mode without looking at map

Actually i am a newbie and i want to add a function in guided mode which prints in the console when the drone has reached its destination. But i could not find anything that could help me to know that my drone has reached its target position.