In 1 Samuel 23 we read while David is on the run from Saul he inquired of the Lord whether or not he should attack the Philistines at Keilah. The Lord told them to attack. Obviously David's men were not impressed because this would give away their location to Saul.
After the victory, the very people whom David delivered ratted him out and David and his men were forced to leave and live on the run once again. It is during this time we read of another incident of David and Jonathan meeting. In verse 18 we read: And Saul's son Jonathan went to David at Horeb and helped him find strength in the Lord.
Jonathan shows us how a true friend acts. David is tired, on the run, and discouraged - after all Saul wants to kill him. So what does his friend do? He helps him find strength. Where? In the Lord. Jonathan points to the Lord's faithful promises: My father Saul will not lay a hand on you. You will be king over Israel .... God made a promise and he will deliver.
We ought to thank God for friends who build us up in the Lord during difficult times. We also ought to seek to be a friend, not with vain words or false encouragements, but rather by pointing to the Lord's faithful promises, especially as found in Jesus Christ.