If you wake up feeling terrible, then you can ask for AOC bedrest (AOC - Air Officer Commanding, usually an O-4 commanding your cadet squadron). The AOC usually delegates that the cadet squadron commander (highest ranking 1st degree cadet in the squadron) will be the approving official for AOC bedrest.
Typically (depending on the squadron) the policy is that if you ask for AOC bedrest, then you are required to make an appointment at the cadet clinic to be seen by a doctor. This is to keep cadets from abusing the system. The doctor at the cadet clinic can put you on a "Form-18", sometimes known as profile, with certain duty restrictions based on your illness. This could be bedrest, academics only, etc. As a cadet on bedrest, there are other cadets whose responsibility will be to make sure you get food (aka "box nasty"/"tray tasty"). You put a note outside your room indicating that you are on bedrest which means that you can have your door closed for the entire day. You must also email your instructors and let them know you will be missing class.
You are not confined to quarters, but you can't be put on AOC bedrest and then go off base to get Chik-fil-a or something.
This is typically how the system works, but there are variations depending on which squadron you are in.