You will know.
I had 3 cats and a dog. Cat 1 had kidney problems and simply, due to age, slowed down. He stopped purring and looked generally tired. 10 mins. after I'd asked the Vet to attend, cat gave a big sigh as though he knew.
Cat 2, my best little girl who was by my side when I was depressed: developed a tumour under her chin which infiltrated upwards. For a few months when she was feeding she would paw her mouth due to pain. The Vet gave her pain relief that morning, on getting home she hid in the cupboard. I knew then that she was ready. As the pain relief began to work she had a very good dinner! The Vet came that afternoon.
Cat 3 had a liver tumour. I noticed it when he ran downstairs, his belly was full. He lived 17-18 months with it but as it spread his belly got smaller. When he could no longer keep a meal down: there wasn't room: that was it. He wasn't poorly ill but would have deteriorated fast. Same Vet.. 9 days apart.
Then the dog
. "If it should be that I grow old and weak ......... " helped me make my decisions. Didn't stop the tears. Hindsight shows that I did keep the dog about 5 weeks too long but in between sleeping, she was her bright self.
. Not in pain though.