No stress! You have unlimited attempts to take your licensing exam as long as you are within 10 days of your 180-day eligibility period. Keep in mind, though, that each attempt will cost $56, even if you are only taking the state or national portion.
If you failed your licensing exam, you cannot reattempt the same day. Instead, you can contact PSI the next day to reschedule by calling them at 855-579-4638 or going online to reschedule your exam here.