Hydrogen has some advantages and thus is superficially attractive, but it has many downsides too. It has however been heavily pushed by vested interests who already have shipping and distribution networks for various other gas and liquid fuels.
First you've got to make it (extract it from other materials), this takes energy of course. The cleanest way to make it is by electrolysis from water using renewable energy. However most hydrogen available today is actually extracted from fossil fuels.
Then you have to put it into a portable form that can be moved around reasonably efficiently. This is either compressed to high pressures (so you need a heavy high pressure cylinder), and the compression takes more energy. Or it's supercooled so less pressure is needed to liquify. This cooling takes energy and also refrigeration equipment to transfer and store.
Then you have to get it into the car. So high pressure fuel lines and couplers at a filling station.
Finally of course your car needs a suitable storage tank. Cryogenic probably isn't the right way here, so you need high pressure: 350-700 bar, much more than scuba tanks, and they are dangerous enough if misused. There are other means such as interstitial storage, where the atoms are physically stored inside the atomic structure of other materials and chemical storage where it is reacted with another substance. This reaction needs to be easily reversible.
One massive issue with hydrogen storage is the fact the hydrogen atom is tiny. It's the smallest atom in the universe: one proton and one electron. So it tends to leak through just about anything; not just bypassing seals but physically permeating between the atoms/molecules of whatever you put it in! If you choose steel, then this can cause the steel to become brittle and crack.
Compared with BEVs, the issues are much bigger. For BEVs they are availability of lithium and other minerals, weight of the cells and potential thermal runaway with damaged cells. But a 700 bar pressurised hydrogen tank exploding in a car isn't a great prospect either!
It doesn't really stack up except for large commercial vehicles in organisations who can run much of their own infrastructure.