A flavor enhancer! No rule, spell, ability, or mechanics changes, only cosmetic reflavorings.
Setting your campaign in the Hogwarts Founders (medieval) era is the absolute easiest way to make the standard D&D setting and prewritten adventures work with Harry Potter lore.
Please leave a comment if you have any more ideas!
Play other D&D Races as-is using The Extinct Excuse, detailed below.
Assuming you’re playing in founders’ era (1000 years before Harry Potter), if monsters and races in your D&D campaign don’t show up in the HP books you can say that they’re extinct by the modern era.
HP-universe goblins are very similar to D&D dwarves, so a simple rename is easy. But, how to explain all the evil, dumb D&D goblinoids running around in published adventures? My lore is: Some goblin societies collapse, losing their intelligence, becoming evil and aggressive. Their skin turns green and their eyes red. Whether it’s a curse or an illness, (or they dug too greedily and too deep), nobody knows, but it’s incurable. They’re called “Green Goblins” or “Groblins” for short.
House elves owned by a family could be warlocks, with the wizarding family they serve as their patron. This helps explain why in canon house elves seem to want to be essentially enslaved, and why some house elves may look down on house elves who do not serve families. Free house elves may not have magic powers, or could be clerics, paladins, etc. I see Dobby as a paladin who derives his magic power from the oath he swore to protect his friends.
In canon, Veela are pale-skinned, blonde, and female. Personally, I don't like having an entire NPC race be all white-skinned blonde women, and I wouldn't restrict the player characters' appearance to that either. So, I've modified my Veela lore from canon. In my campaign, Veela are beautiful, usually female, and have any non-human hair color. Pink hair, blue hair, hair that looks like it is stands of metal, hair that reflects light like a gem, etc. Their hair can be any texture or style, their skin can be any human color, and they can be any gender though men are very rare. Half-Veela males are common though. I take into consideration that in a largely single-gender society, gender roles and other societal binaries around gender likely wouldn't exist.