Friendship with the upright, with the truthful and with the well informed is beneficial. Friendship with those who flatter, with those who are meek and who compromise with principles, and with those who talk cleverly is harmful.
We will sometimes have defeats in life but you can have defeats without being defeated, you could fail without being a failure. When you see failure and defeats as merely part of the process to get to when.