As someone who has played both, Java is the way Minecraft is meant to be experienced. Everything from the way water looks, to the way redstone works, down to the underlying game engine, Java is the superior version in my opinion.
However, it is only available on Windows, macOS, and Linux. If you have a mobile device (not counting 2-in-1 tablet laptops, those typically run Windows and support Java just fine) like a phone or regular tablet, Bedrock is the only version available. Bedrock is fine for many players, but understand that it is a noticeably different experience. It's still Minecraft, you can still do much of what you can do in Java edition in Bedrock. The differences are mostly technical, and I encourage you to do your own research regarding how they compare before you make a purchase.
If you intend to play Minecraft only on a desktop PC or laptop, buy Java edition, you will not regret it. If you intend to play Minecraft only on a mobile device, buy Bedrock edition. If you intend to do both, well, you'll have to get both. But if the desktop/laptop experience is available, take my word for it, Java is just better.