Don't let one failure stop you. Everyone fails at times. Give yourself a specific amount of time to feel bad about it. After that, get started on something to move forward. It doesn't have to be big, as long as it is a step towards forward. Sometimes it can be taking a shower and putting on clean clothes.
I would consider why you failed the class to help figure out how to move forward.
-Outside factors taking up time, leaving you not enough to focus - figure out if those distractions will subside or what you can do to control them. Maybe something happened during the semester, maybe you need to take fewer classes at once, maybe you are just adjusting to the independence of college.
-Uninterested in the topic - It could be a sign this isn't the right field of study for you. One thing to keep in mind though, just because the academia may not interest you, doesn't mean the job that comes from having completed this field of study doesn't interest you.
-Struggling to understand - Just because you struggle, doesn't mean you won't eventually do well. In fact, people who struggle often come out with a much deeper understanding of the topic and ability to persevere through challenges. But you should make sure it's something you want to persevere through.