Unfortunately, your crush said no. It would be best to accept that your crush isn’t interested in you romantically and move forward with your life.
Trying to find a solution so as to get your crush to like you back will only lead to more frustration and rejections.
You have liked her for 2 years and there must have been a lot of emotional buildup before telling her about how you felt.
Hence, it is okay if you need time to process this rejection and decide to avoid your crush for a while.
However, you shouldn’t be bitter.
Try to take some positive lessons out of it.
One of the biggest lessons to take from it is to ensure that you let a crush know how you feel about them early on.
In other words, avoid waiting for a long time before telling them. In your case, you waited for 2 years.
Sometimes, the quicker you are in letting a crush know how you feel about them, the higher the likelihood that they may entertain the idea of becoming romantic with you.
When you allow a friendship to go on for years, it gets that much harder for a crush to look at you as anything other than a friend. This is especially true, if you never give your crush any indication of romantic interest from the start.