It happens to everyone. Take a couple of days or more to let the bite of rejection start to fade. Then go back to carefully and calmly reread the rejection letter to see if it gives you any clues about what to do next. Is there a possibility of revising and resubmitting? If not, is there any feedback that might help you strengthen it before submitting to another journal?
Check out this article for more strategies about dealing with article rejection “How to Deal with Rejection from Academic Journals (And Steps to Take before Resubmission).”