Well, we have all had to deal with that issue at one time or another during our lives. No matter how many of have "been there" and tell you that it'll be okay, it never is easy to do. Dogs (and cats too) are part of the family and losing one of them is truly a heart-breaking ordeal; yet it is still all worth it because of the intense joy they bring to our lives.
I had two Black Labs - one of which passed on her own after an illness at the age of 13 and another one I had to put down at the age of 15 back in 2010. I have seen a few car crashes with fatalities, a homicide, a suicide and a lot of other bad stuff during my life, but parting with my old friend Rebel was still one of the hardest things I ever had to do. My ex-wife and my son were both there as well, so at least the big boy was with the three humans he loved the most.
Dogs are very intuitive and you can almost tell that they "know" it is time. I swear that dumb old Lab was 'ready' to go and walked right in to the vet's office that morning - when he used to resist. He was deaf, had cataracts, one bad hip that made lifting his leg difficult and had lost most of his appetite. His weight went down from 90+ to about 68 lbs and he was about 100 years old in dog years; so we did what we had to do. He is resting in peace next to his 'sister' in the back yard of my old house. When the wind blows on a dark night, I can almost hear him walking around in the back yard!
I am tearing up now just thinking about it, so I know how you feel. Remember that you have the fun memories and enjoyed the unconditional love of your furry friend for so many years. Nobody can put a value on that!
A dog is the only creature that loves you more than he loves himself!