Collect 50 Tera Shards of the Tera you want to change your Pokemon to, then go to the Treasure Eatery Restaurant and speak to an NPC.