First and most important thing is that completely clean the opened wounds in your mouth before starting the process of stopping it.
Take an ice cube and such it if your mouth is bleeding at the moment as it will stop the blood or will slow the bleeding.
Use an antiseptic mouth wash and rinse out your mouth completely. Try to repeat this process at least once in a day but doing twice is better.
It is better to get a complete check up of your mouth, jaws and teeth from an orthodontist or dentist. He/she will let you know whether the cheek biting have caused you any trouble in your teeth or jaw.
You should use a chewing gum which will keep your mouth busy and you will not do any damage to your cheeks by biting them even unintentionally.
Basically, your brain tells you to bite your cheeks as it has become your habit. You can also try a therapy which will help you in keeping in mind all the time that you have to stop cheek biting.
You can also employ hypnotizing method to train your brain and let it know that biting your cheek from inside is something not good for you.