You buy a physical deck of Club Penguin trading cards. Each pack contains a code you can redeem online for items or coins.
There's no way to generate one for free — the codes exist to drive card sales, so a code found floating around online has almost certainly already been used.