When it was time for my dog I found she became really clingy. She needed me by her side for comfort. Just knowing I was in the room and close by made her feel safe. Make sure your cat is comfortable if she/he's at the stage they can't walk. At very end they will refuse food altogether.
Talk to your cat, thank them for the life you had together and how happy they made you. Pets know when it's their time to go. Whether you take them to the vet or stay home in their last moments is up to you. Having their favorite person by their side really helps.

my cat is dying. i don't know what to do.