Melee combat sword system

Hi. First of all I want to say that I have a basic knowledge about C# and i want to make a combat system with sword.
I know I can do it in different ways:
For example I can use the OnCollisionEnter functio, or I can invoke the Damage function when I press the left mouse button and when the enemy is in < 2 range, but I think there are different and better ways to do it.
How would you do it?

I don’t know exactly what the code would be, but maybe have trigger colliders (4 with one on each side if top-down and no rotation, one if top down with rotation, or maybe some other configuration depending on the game style) and if the mouse is clicked (The player attacks) while an enemy is within one of those triggers (You’d have to ensure it’s the right one if you use multiple) then damage is done to the enemy. I hope this helps a little with getting ideas together.