You can change your Pokemon's ability in Pokemon X and Y and onwards by using an Ability Capsule. A pokemon's ability cannot be altered in earlier generations. Moreover, you can change your Pokemon's ability to a Hidden Ability by using the Ability Patch. This item will only work on species of Pokemon that have access to a Hidden Ability. I recommend breeding this Pokemon as its offspring will inherit the Hidden Ability alongside a normal ability. The Ability Patch is only available in generation VIII, such as Pokemon Sword, Shield, Brilliant Diamond, and Shining Pearl.