From what I read (take it with a grain of salt) , you have to inflict upon yourself enough severe damage to kill yourself but be saved before you die (so your organs won't fail yet when you'll reach the hospital) and only if you're pronounced brain dead (or your family decides to withdraw care if it has been decided that your recovery would not be compatible with quality of life ) while connected to machines in the hospital, they can use your organs for donations. I would advice you to not attempt doing this sort of thing because you'll be in extreme agony, and too many things can go wrong and not according to your plan (maybe they decide your recovery will be sufficient and keep you alive and well). I read cases of suicides that the person who killed themselves asked to donate their organs but it hasn't been done, but there were definitely rare cases that it happened (but again, so much can go wrong).
If someone knows a trusted method to keep organs functional for donation , I'd like to know as well (have been considering it myself but read online cases and it's mostly people that were saved last minute to then die at the hospital)
I wish that this society was pro-choice and we could just go to the hospital for assisted suicide and donate all our organs, but unfortunately this is not feasible at the moment.