I'm sorry he's passed, it's terrible losing a fish, especially when you've had to contemplate euthanasia. It's one of the downsides of being responsible for their lives, you also sometimes have to be responsible for their deaths.
I've had to euthanize several of my fish when they were in obvious distress. I simply scoop the fish out into a container, pour most of the water out and then wrap the fish up in a damp cloth or old tee-shirt. Then I would just locate the head and deliver one very strong blow with something like a shovel. It sounds horrible but it is one of the quickest and humane ways to kill a fish if done correctly, since it crushes the brain and it's an instant death.