Vanish vs Stealth Macro

How do I make a macro that will use Vanish ONLY if I am in combat and use Stealth when out of combat?

Sorry I am a noob and you guys are amazing at this

Hello James, try this and see if it works:

/cast [nostealth,nocombat] !Stealth
/cast [nostealth,combat] Vanish

That works awesome! Thanks Luis

I am having difficulty with another macro locking up and I will post it soon for your inspection