Unfortunately an unavoidable part of the academic journey is rejection.
Even the best professors have once been rejected.
The one thing that should motivate you to try again is that if you don’t try again, rejection becomes final. You have the power to reverse that rejection.
However, be aware that you must look critically at your application. Sometimes you need to switch things up! Apply to a different country or school or contact a different supervisor.
Whatever is it, try again (or redefine your goals) and keep moving!