Banning users have been thought of as a way by Niantic to prevent cheaters from getting to play Pokemon Go, therefore it's necessary for you to be informed on what gets users banned, and the things you can do to get back in the game and play with the pocket monsters you spent so much time trying to catch.
How do you not get banned in the first place?
The simplest way to prevent this from happening is to abide by all the provisions of the Terms of Service, which are shown to the player before everything else. The reality, though, is that users are too lazy to read them and are, therefore, unfamiliar with a lot of them.
Niantic is pulling out all the shots to mitigate robot activity. Makers of bots to change some elements of the game and their patrons shall be given a ban which would last a lifetime.
Other things which would cause Niantic to ban you include using devices which would deceive your phone's GPS system to allow eggs to hatch within a shorter period of time, or be able to catch Pokemon which can only be found in certain places. Other things which would cause Niantic to ban you for a lifetime include the use of emulators.
An example of such device is the one which enables you to play on any device other than through the app on your smartphone. The safest means for you to not get banned is to not make use of third-party software or application of any sort.
How to get back in the game after getting banned
You have to make sure first that you have actually been banned by Niantic. Apart from not being able to log in, the company would also be sending an email to confirm that they have banned you. There have been reports, however, on players getting banned despite not violating any of the Terms of Service.
The servers, in this case, must simply be down. To verify, simply have a look at your own inbox. Other bans, however, don't last a lifetime. Bans of this kind run for a span of a couple of hours, and no notification by any means would be given. Playing the game too fast is believed to be the cause of the temporary ban.
Should you be banned without violating the terms of service, however, something can be done. All that you have to do is pass a ban appeal through Pokemon Go's official website.
Sending the appeal is your only way to get back to playing the game, and it would take Niantic up to a few weeks to reply. Users who send a ban appeal gets a reply.