This is not always possible.
If you have no nintendo account coupled and lost the phone which was used with the app for setting it for instance. In that case the only option is to send it to nintendo for repairs (they do a complete reset). I have my doubts if they 'repair' a banned device though ...