If you reduce a creature to 0 Hit Points with a melee attack, you can knock the creature out. That melee attack isn’t restricted to weapons. Even a melee spell attack can be used to knock a creature out.
EDIT: the rule only says "melee attack", so this includes weapons, an Unarmed Strike or spells, as explained in the SAC.
Knocking Out a Creature
When you would reduce a creature to 0 Hit Points with a melee attack, you can instead reduce the creature to 1 Hit Point and give it the Unconscious condition. It then starts a Short Rest, at the end of which that condition ends on it. The condition ends early if the creature regains any Hit Points or if someone takes an action to administer first aid to it, making a successful DC 10 Wisdom (Medicine) check.
can you still use magic melee actions to subdue a creature? the wording has changed slightly.
is a magic melee action the same as a melee action for this purpose?
Yes, same as in 2014. Next answer is from the 2024 SAC:
EDIT: the rule only says "melee attack", so this includes weapons, an Unarmed Strike or spells, as explained in the SAC.