system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Why does stretching feel so much better right before you go to sleep and right after you wake up?

I've noticed even simply raising my arms above my head, which isn't usually stretching, feels good.
Why is this?

Thanks!
gpt
Before you go to sleep: Depending on the stretch, you can release gases and muscle waste. Mostly, it's a way of relaxing your muscles. Instead of them being tight, you give them a good stretch so they can be more flexible and keep you from cramping and being sore when you sleep.

Waking up: After having your body relatively still for several hours, giving it some movement before going through your day is good for you. Not only does stretching get your blood circulating faster, but it can prepare your joints and muscles for the day, and remove or work through any stiffness. After a good morning stretch, your brain releases and spreads more of the stress and wake up hormone cocktails, which include cortisol.

I hope this helps your understanding.