Along the way, you collect goodies - mainly Bertie Bott's Every Flavor Beans, Chocolate Frogs, and collectible wizard cards - while vaguely drifting through the canon storyline. Almost exclusively playing as Harry, you learn spells from the teachers to get through the Malevolent Architecture of Hogwarts and win Boss Battles.
The earliest Harry Potter games were realized as typical Action-Adventure games with the usual tropes of Inexplicable Treasure Chests, Rewarding Vandalism, Bottomless Pits, Floating Platforms, and so forth.