usually emergency calls only does not require a code, this can also mean you have lost singal, try settings, connectivity, network, then do a manual search, that usually fixes the issue for me...
Best of luck
What code is your phone asking you for exactly?
The default security code is 0000 while the default SIM card PIN code is 3436.
If the security code was changed and you cannot remember it, you will have to send your phone in for repair through the Repair and Loaner service, available in most of the Fido stores.
If you have changed your SIM card PIN code and do not remember the new code, you would have to enter a wrong code 3 times for your phone to ask you for a PUK code. this code can be obtained via customer service by chat through My Account on Fido.ca, e-mail through the Contact us page or phone by calling 1-888-481-FIDO(3436) or 611 from a Fido phone.
I hope this helps!