You should review sticky on Macros: Essential Info at the top of this forum
Macro’s support some conditions, they can differentiate between friend (help) and foe (harm) and live and dead and a few other things. They cannot differentiate on cooldowns, buffs, target life, range, and many similar “smart” choices.
Lots of players use addons like TellMeWhen and WeakAuras to track cooldowns and other stuff that help them make decisions. Then write macros to “switch” between 2 spells (like Call Felhunters and Shadow bolt) by when you hold down modifier keys (ctrl, shift, alt). For example,
#showtooltip
/cast [mod]Call Felhunters;Shadow Bolt
Ultimately Blizz wants you to make the choice of who to target and what to cast and when and the macro’s are oriented for that.
After you review the stickies in this forum, here’s some good additional resources on Macros
https://wow.gamepedia.com/Macro_commands
https://wow.gamepedia.com/MACRO_cast
https://wow.gamepedia.com/Macro_conditionals
https://wow.gamepedia.com/UnitId