I have a test coming up that counts for a large portion of my grade.
Is this test a thing you've been studying for?
I've been sick and couldn't study much due to that.
Inform your teacher of your circumstances. Maybe they'll extend some leniency towards you.
I told my teacher but they said I should have informed them earlier.
You did the right thing in letting your teacher know, but it's not your fault that they're unreasonable. You can't 'help yourself for being sick. It's not great advice, but suck it up and do your best with the test.