Note: there is no condition called Hiding.
Everything to do with Hiding is determined by Stealth.
If you attempt to Hide, you’re attempting to be Stealthy. So, do a Dexterity (Stealth) check and write down that number.
If someone is looking for you they need to do a Wisdom (Perception) check against this to find you.
If you attack when Hidden then other side may be Surprised.
To see if Surprised, compare Dexterity (Stealth) with passive Wisdom (Perception) of the target.
Surprise: if you’re Surprised you can’t move or take an action on the 1st round of combat.
Note: when a creature can’t see you, you have advantage on attack rolls against it and it has disadvantage on attack rolls against you.
PHB p.194 and p.195
Note: in Melee this doesn’t work ‘cos the enemy will see you when you pop out: