I came across this precious piece of practical advice on friendship in the writings of Ben Sirach (Ecclus 6:5-16), a Jewish scribe from the 2nd century BC.
A kindly turn of speech attracts new friends, a courteous tongue invites many a friendly response.
Let your acquaintances be many, but for advisers choose one out of a thousand.
If you want to make a friend, take him on trial, and do not be in a hurry to trust him;
for one kind of friend is so only when it suits him but will not stand by you in your day of trouble.
Another kind of friend will fall out with you and to your dismay make your quarrel public,
and a third kind of friend will share your table, but not stand by you in your day of trouble:
when you are doing well he will be your second self, ordering your servants about;
but, if disaster befalls you, he will recoil from you and keep out of your way.
Keep well clear of your enemies, and be wary of your friends.
A loyal friend is a powerful defence: whoever finds one has indeed found a treasure.
A loyal friend is something beyond price, there is no measuring his worth.
A loyal friend is the elixir of life, and those who fear the Lord will find one.