Niantic Rewards is how you redeem codes in Pokémon GO. You can redeem codes either on the Niantic Rewards website or through the game menu. Knowing how to input codes will be important if you're playing on an iOS device.
Niantic Rewards: How to Redeem Pokémon GO Codes on iOS
If you're on Android, you can just go through the game's menu to redeem codes. The process is a little more involved for iOS, requiring you to go to the Niantic Rewards website to redeem codes.
To redeem a code online, you simply have to log into your account on the Niantic Rewards website. This is the only way to redeem codes if you're playing Pokémon GO on iOS. The Apple App Store has some regulations on in-app redemptions that will require you to go through the website.
Where do you get codes? Niantic periodically releases codes when they collaborate with other brands, or as an incentive for players who've been away from the game to return. Sometimes, Niantic releases codes for events. Codes are typically limited and can be used only once. There aren't many codes floating around, so be sure to try all of them. There's no penalty for entering a bad code, after all.