Last summer I was sitting at a banquet, eagerly awaiting the sweet ending to an amazing dinner. But when the waiter slid a plate onto the table setting before me, I was immediately disappointed. On it was a plain, old-fashioned slice of cheesecake topped with a dab of caramel.

I glanced to my left and saw the plate of the woman next to me. She’d been served a delectable-looking slice of chocolate cheesecake that made my mouth water. I silently coveted that piece of heaven but kept the thought to myself. My tablemate, who was eyeing my slice, did not.

“Any chance you’d like to switch?” she asked to my surprise. Elated, I quickly pushed my boring dessert her way and accepted hers instead. In a second, we’d both gone from disappointment to delight.

Now imagine that instead of being offered unwanted cheesecake by the waiter, I had been introduced to a single woman by a friend. Or perhaps I was interviewing someone a colleague recommended for a job. And, as with the cheesecake, I wasn’t interested in dating the woman or hiring the referral. As odd as it sounds, people are like that slice of cheesecake. Just because I didn’t want the slice I got didn’t mean it wasn’t perfect for someone else. In life, rejection isn’t meant to hurt your feelings or harm you. It’s meant to arm you with the knowledge you need to move on to your destiny.

But overcoming opposition is rarely as simple as a swap with the person next to you. And it’s often a very painful blow to your ego. You can better handle being turned down and regain balance by understanding the reason you were refused in the first place and then moving forward from there. I’ve found there are three main reasons for rejection:

1. People reject us when we exceed their expectations.

Ever wonder if you weren’t hired because your experience level meant they’d have to pay you more money? Maybe that guy didn’t call you for a second date because he took one look at your Prada bag or Louboutin booties and it made him think he wouldn’t be able to keep up with your pay grade. Sometimes we’re rebuffed for doing well. Other times it’s for doing right. Maybe your family snubbed you because you didn’t want to pretend to be a job reference for your slacker cousin. Or you’re put at arm’s length by coworkers because you refuse to cut corners. Either way, you’re too right or too good for what’s being asked of you. Worstcase scenario, someone hates on you. When the expectations are unreasonable, the solution isn’t to change your standards. After all, what if you downgrade your wardrobe for your next first date and the guy shows up wearing Prada shoes? If you shift who you are to meet others’ expectations, when going out for the right job or the right guy, they won’t recognize the real you. Instead, embrace the idea that being passed over is one of God’s tools to help you be you to the fullest. Your best strategy, like the woman next to me at the banquet understood, is to make the most of a situation and keep your eyes open for other options that may be just right for you.

2. People reject us when the timing is off.

Your sister won’t float you a loan because she hasn’t told anyone about the enormous credit card debt she inherited from her husband. Or you don’t get the job due to the bad economy. Or your boss doesn’t approve the project you pitched because there’s not enough cash in the budget to implement it. Your task is to keep your head up, and have faith that God is using this difficult period to move you forward. Instead of complaining about the disappointing cheesecake or that your sister didn’t come through for you, consider that this might be the time to take on a side hustle for the extra cash. You might find it more successful or life-changing than you anticipated. It may give you the experience you need to land the position of your dreams. Shift your vision from the lack of employment opportunities and consider changing your career focus or going back to school to pursue a higher degree.

3. People reject us when we don’t meet their expectations.

This is the most common cause of rejection. We are let go for being wrong or doing wrong. Being wrong can simply mean we’re not what the other person wants. We don’t make enough money for the rent on a new apartment, we don’t meet the qualifications for the job, or we don’t have enough in common for a real friendship.

Sometimes we throw ourselves out of whack trying to connect with people or social groups that aren’t a good fit. We think they’ll lead us to happiness. Rejection restores balance to your life by reminding you of who you really are.

Sometimes we’re given the heave-ho for unacceptable behavior, such as flirting with your best friend’s boyfriend or losing a big client at work. The lesson here is simple: It’s time to straighten up and fly higher.

People who fail to learn this lesson may miss out on their destiny. Being rejected isn’t the end of the road. It’s a means to an end, helping to reveal your purpose. Armed with this knowledge, you understand that God is closing one door to redirect you to a better door, one that leads to your best life. Continue chasing after pursuits that weren’t meant to be or simply can’t be, and your life will stay out of balance. You’ll be unsatisfied and you won’t achieve your goals. Refocus yourself on the lesson, and you’ll find joy and reach your purpose.

The last and most important step in dealing with rejection is forgiving the person who refused you. Know that he or she actually helped you. Understanding why you were shunned gave you the tools to succeed. So the next time someone turns you down, think of the chocolate cheesecake. Smile, as you know that God is using such rejection to turn you to another person, another project or another place that’s meant only for you.

Minister O.J. Toks is the author of Rejected for a Purpose: How God Uses Rejection to Help You Find and Fulfill Your Destiny (The Elevator Group).