Find the old one (in your mail or on your backup or whereever you stored it) or buy a new one or don't use the program any more. Those seem your only options, apart from contacting the maker, explain the situation and hope they are willing to give you a free code or find yours in their records.
Better store that code carefully. You'll need it again if your PC goes south and you have to buy a new one.
It's like buying and losing anything else. You can't really expect, say, Apple to give you a new iPod if you lose the old one. Or Ford to give you a free key to your car if you lose yours. Or this company to give you a free registration code.
I recently had my hard drive replaced. Since that time I have had a problem with my one program. I downloaded it again from web but it says it is trial and they want me to buy it again or else have a registration code from when I bought it 2 years ago. I have no idea how to find my code. What can I do? I cannot afford to buy this again since I am on a fixed income and retired.