Obtain a registration certificate or discharge

How to obtain a registration certificate or discharge?