It's not that you will get banned, it's more like, you run the risk banned at any time. There's a reason why people say don't bot on an account you can't afford to lose.
If you want advice, the internet is full of that, but everyone has their own opinions and experiences on how to not get banned. In general though if you are trying to bot an account you plan to use normally then I think it's important that you a) don't be greedy (don't bot extreme hours), and b) play the account normally in between botting sessions. Even then, you could still get banned.