How does this minecraft Elytra work?

When I try to fly and jump off a cliff it sometimes work and sometimes doesn't. I jump and press space bar and sometimes it glides fine. And other time when I jump and press space bar, I just fall and die. I try pressing space bar and hold, but no difference. Am I doing something wrong?

You need to be looking up, if you look up, you fly up, if you look down, you fly down.
You can't actually die from regular fall damage while wearing an Elytra - it makes me think you were looking down, then activated flight mode and so 'flew' down at maximum speed and hit the ground that way, which CAN kill you.

The wing thing didn't even open up and I was looking up