The only way to avoid being hurt is by acknowledging that pain, hurt, and disspointment are inevitable.
The reality is that there is going to be pain, hurt, and disappointment in all human relationships. This is because we are imperfect. None of us are loving all the time. We are, by nature, self-centered. Consequently, we hurt each other—most of the time unintentionally. The fact is that if you're going to have relationships, you're going to have times that you will be hurt. You have to accept that. Then, when you do feel hurt or wronged, you lovingly confront the perceived wrongdoer and try to work through that difficulty so the relationship can continue.
Disappointments are by-products of our own expectations. If you have no expectations of someone, they can't disappoint you because there's no expected standard they either meet or fail to meet. Adjust/let go of your expectations of that person (even if they are totally fair) so that you won't be let down when they dont do what you think they should. Some people will never do what they should. It's up to us to accept that & balance our hopeful view of others with a good dose of realism.