Use Pokemon Refresh
Pokemon Sun and Moon brings back the Pokemon Amie feature that was first introduced in X and Y, except this time, it’s called Pokemon Refresh. With this feature, you’ll be able to use the 3DS stylus to pet your Pokemon’s head, rub its belly, and feed it Poke Beans. This will increase the Pokemon’s affection for you. However, aside from just having cutesy time with your Pokemon, Refresh also provides a valuable service to you at the end of each battle.
If your Pokemon receives a status ailment during a battle, tap the Y button at the end of the fight to activate Pokemon Refresh. Here, you’ll see a selection of tools you can use to care for your Pokemon. Some will let you clean your Pokemon, while others will let you get rid of the status ailments. This allows you to heal up your team without having to waste a precious item.