I feel like alignment should just be a very minor thing that develops without the player even knowing.
It could have in game consequences like with dialogue options, but it should be almost insignificant, especially at the start. Like if everyone started with a hidden default alignment of True Neutral, with the actions you take affecting your alignment as you go.
What we definitely should not use are the antiquated class restrictions that alignments gave. The only one I would think would matter is the relationship with your deity if you are a Cleric, and that shouldn't be a restriction either, maybe more like if your alignment shifts too far from your deity then it triggers a quest at your campsite where you either correct your course or choose a new deity, and maybe that's something that every class could even do if we all had the option to choose a deity, Clerics would just be that much more invested because it relates to their class.
Pretty sure I've spoken at length about alignment on here before, but I am happier with Wizards pushing alignment from a mechanical system to a roleplaying system. I know that my experiences playing D&D are not universal, but I have lost count of the number of times I have seen the alignment system abused or misused as a stand in for actual role-playing. Eg: "It's what my character would do because *insert overly simple explanation of alignment*, or a Paladin who uses the claim of "but I'm lawful good" when their party accuses them of being a terrible person, because they've been acting like terrible person. Ever see a grown adult just about throw a tantrum because their DM told them to change their alignment from chaotic good to chaotic neutral? People getting too attached to specific alignments without actually thinking about how their behavior affects said alignment. Actions inform alignment, not the other way around.
Alignment should be something you think about when choosing your background, as part of what makes up your character's motivations, ideals, and flaws, not a series of hard mechanical rules (at least, not for players characters). I consider the motivations, ideals, and flaws from the background to be part of crafting my character's morality, their alignment.
As for Clerics, it's an odd case. Alignment *is* a series of hard mechanical rules for deities, and other planar creatures. It's part of their fundamental beings, and if they change their alignment, then they change what they are. Even in their revisions of alignment, Wizards kept this intact, and they don't seem willing to rewrite their cosmogony entirely. Clerics are still attached to deities, and probably always will be, so there is an argument to be made for a Cleric staying close to their deities morals, their alignment. This is how it worked in 3.xe actually, your personal alignment couldn't be more than one position removed from that of your deity, and while I'm not a fan of the hard alignment mechanics, I also don't think Clerics should be able to get away with acting against their deities' values and tenants without some kind of consequence.
EDIT: I forgot to talk about alignment as a video game mechanic. my bad. So it really depends on the game, because sometimes your alignment is a fixed value that offers specific actions in game, and sometimes it's a flexible value that can change as you take specific actions in game. I prefer it as a flexible value, but video-games are usually more limited in what options you are able to take, which don't always fit well with the alignment you've made for your character.
Take Neverwinter Nights 2: you will always become Knight Captain, regardless of your choices or alignment. Even if you are the most selfishly evil bastard who cares only about themselves and not the wellbeing of the city-state of Neverwinter. This is a limitation of the format (and exacerbated by the fact that the game had initially planned to have more options for non-good characters, but they got cut). Usually alignment in video games is something that I work around, not with.