@ArabellaScott outliers, abuse and unintended consequences definitely need to be considered and the legislation to be written in a way to minimize this as far as is possible.
For terminal illnesses, it seems relatively easy - two separate doctors' permission, one not connected to the organisation carrying out euthanasia. (of course that depends on how the euthanasia possibilities are set up in that particular country, whether it's a separate organisation or whether it's extended within the hospital).
If euthanasia for mental distress was/is permitted then something like a 5 year period between first application and then consent, with interviews by two separate and unconnected psychiatrists seems reasonable (to me, at least). For Dignitas you have to have the two interviews and to have a written report saying that the psychiatric distress is long term, treatments have been attempted and it's incurable.
For extreme long term but not terminal pain, then something like the psychiatric path would also seem a good idea.
The subject of euthanasia like abortion is incredibly complicated and difficult. It's one of the subjects where each individual case is what matters, but we're trying to legislate for an entire society. Fundamentally allowing euthanasia means that some wrong decisions will probably happen. Not allowing it means that some people will suffer extreme pain and a horrible death, the likes of which we'd certainly not allow animals to experience. Honestly, the fact that an active action rather than a passive action is needed to bring death does make a difference here, but I personally think that if a well trained compassionate professional team is willing to do that, then it should be allowed.