How do I tell a boy that I'm gay?

I need help, like urgently

So this summer I've been with this guy and we've gone on a couple of dates and I've kissed him and he's gotten really emotionally attached.

The only problem is it's made me realise I'm gay. (I identified as bi but being with this guy has made me realise im not interested in boys at all)

How do I let him know this without him hating me forever?