If you cannot recover the code/password, you will need to request a new idCAT Certificate in person at an idCAT Registration Entity.
At the Registration Entity, when you apply for the certified idCAT, they make you enter a "personal code " that only you know (usually 4 numeric digits). There is no way to recover it (it's done this way for security: only you know it).
You will find it on the delivery sheet that was given to you at the idCAT Registration Entity and in the email you received with the instructions for downloading and installing the certificate.
When you install the idCAT Certificate you have the option of adding a PIN for use that will be requested every time you want to identify yourself or sign with the certificate.
It is optional and by default the certificate is not installed with PIN and this cannot be recovered. However, if you do not remember it, you can install the certified idCAT again without entering a PIN.
If you have exported your idCAT Certificate, you will have set a password to protect the certificate.
This password is known only to you and cannot be recovered (retries are infinite and no blocking). To create a new one, export again with a password you can easily remember.