To change a Pokémon's Tera type, you need to collect 50 Tera Shards of the desired type. Once you have 50 shards of a specific type, you can exchange them at the Treasure Eatery in Medali to change your Pokémon's Tera type to that type. This feature becomes available after defeating Larry, the Normal type Gym Leader, in the game's storyline. Tera Shards are mainly obtained by completing Tera Raid battles, especially those with three or more stars, with higher-star raids giving more shards. They can also occasionally be found as hidden items in the overworld. In summary, the number of Tera Shards required to change a Pokémon's Tera type is 50 of the desired type. This allows for strategic flexibility in battle by changing the Pokémon's Tera type as needed.