When I turned in an assignment, it froze and said error. I refreshed it and it said submitted. I thought ok its good. When it was graded my teacher said it was blank and gave me a 0. What do I do?
You are going to hate this answer, but it is the same one we give our students all the time - this really is between you and your instructor.
Your school's Canvas support department can guide you to search your own files area in Canvas to see if an un-corrupted upload made it there - not likely, and you can check this area yourself. Learn how at How do I view my user files as a student?
You can use the Help menu to submit a support ticket that will go either first to your school's support department then to Canvas, or directly to Canvas depending on how your school has configured support. Not likely that Canvas support will find an un-corrupted file, either. Learn how at How do I get help with Canvas as a student?
Back to your best bet - talk to your teacher.
For future reference, we see this happen most often (and it is actually a rare event) when students are using an outdated browser or Microsoft Edge without download of the Anniversary Edition. Lately, Edge has been working mostly well. We always recommend using an updated version of Firefox or Chrome. You can learn which browsers are supported by Canvas at Supported Web Browsers
Retrieving data ...