There are a variety of opinions on how to euthanize a fish, so I will start with the least controversial and proceed from there.
Perhaps what many consider the most humane is to put the fish in a small container of water with aeration. The container should be large enough that the fish can swim and to cover the fish’s back, but not too large. Clove oil is available through many drug stores as a cure for tooth pain. Add clove oil to the water drop by drop. At low doses clove oil is an anesthetic, which can be used if you need to do minor surgery on a fish. At higher doses it kills the fish. Note, dead aquarium fish should never be flushed down the toilet. There is a chance that they could introduce diseases into the environment. Just discard them in the trash.
The next method would be to lay the fish on a cutting board and sever the spine, or with small fish, simply cut off the head with a sharp knife. Death is essentially instantaneous.
The third method is to put the fish in a bag or container of water and put it in the freezer. Fish are cold-blooded and their body temperature is the same as their environment. As a fish cools down, all of its biochemical processes slow down and eventually stop. Unless a fish could survive at 33 degrees F, I cannot see how freezing would be cruel. Fish, such as goldfish, might be able to feel some sensation as ice crystals form in their flesh, but most of our aquarium fish would be dead before this happens. Unlike mammals, fish can’t shiver when they get cold.
Personally I prefer the second method. It is quick and I don’t believe it causes the fish any pain. I keep small fish so a quick chop with a sharp knife instantaneously kills the fish.