Flashing is a reliable method to reset a forgotten lock code/security password when a hard reset is impossible.
To flash the Nokia Asha 501 RM-902, you cannot use the standard Android tools (like SP Flash Tool). You will need Nokia-specific service tools. nokia asha 501 rm 902 flash file download