I think one way is to have the pond fairly deep, mine is 2 1\2 to 3’ deep with straight walls and no shelves. I know Herons are tall but that’s pushing it, we also have 5 cats patrolling the yard.
Having a deep pond is good for keeping out Raccoons also, if they can’t touch the bottom they supposedly wont go in, if they can they can eat everything in no time at all.
It’s also good for the temps in the summer and the added water volume.
I’ve seen on some other sites where they suggest 5’ and deeper.