It is illegal to do this in many countries.
The Pet Trust Law Blog says that "euthanasia must be performed by a licensed veterinarian or a licensed or registered veterinary technician under the supervision of a licensed veterinarian."
If the dog is sick and you think its best for its well being to put him to sleep (euthanize it) then you need to take it to a Veterinarian or an Animal Shelter. I have heard that you can also hand the dog over to someone who can perform the required necessary treatments to save the dog's life. In which case you have to sign a contract surrendering the dog to the person who can afford the treatment. You will not see the dog again, and by law you have to stay away from the dog forever.
If the dog is healthy and you just want to get rid of it, you can't just put it to sleep for no reason. Why not surrendering the dog to an animal shelter? They will do what's best for the dog after all.