It’s horrible mate, really horrible.
Only you will know when it’s time, do what’s best for the dog.
I have been unlucky to have had to put 5 dogs to sleep in the last 15 years, the last one was the worst. I had to help do it as a dangerous dog and we did it in the vets car park. He fought until his last breath
Dudley the lab has been on medication for a while for arthritis, luckily my wife works in an equine hospital so get drugs at cost. He was heavy breathing and not moving properly, crapping in the house etc Eyes also not good. Back legs were virtually gone and losing weight. He had a good life.
He was still eating and seemed happy but you could see he was just knackered, struggling to get up etc.
You will know when it’s time.