Well, there are two ways for this purpose. You can sign in through your Google account if you don’t play the game for much time. The other option is Pokemon Trainer club account that you can easily create. This will send you regular codes that are used to unlock some special pokemon.