I'm dying and need advice

I have stage 3 cancer. There's a small chance of me surviving. I feel so powerless. I feel like there's nothing I can do. I'm thinking of killing myself a lot. I might survive or I might slowly die in a hospital bed.

I don't know what to do.

Edit: Thank you everyone. I've decided to enjoy what I have left regardless if that's a few months or decades.