First of all, you cannot cast friends on a creature that is hostile to you.
For the duration, you have advantage on all Charisma checks directed at one creature of your choice that isn’t hostile toward you. When the spell ends, the creature realizes that you used magic to influence its mood and becomes hostile toward you. A creature prone to violence might attack you. Another creature might seek retribution in other ways (at the DM ’s discretion), depending on the nature of your interaction with it.
so you cannot somehow 'tame' them and cast all sorts of debuffs before start attacking them again. It only gives you advantage on all Charisma checks against the target, and nothing more. It does not cause the Charmed condition, which prevents the target from attacking you.
Second, most of the time, a creature doesn't know that a spell has been cast on them, unless it has a perceptible effect. For example, a fire bolt has a bolt of fire shoot from your hand, so the enemy knows you cast a spell on them.
From the "Targets" section of the rules on spellcasting (PHB, pg. 204):
Unless a spell has a perceptible effect, a creature might not know it was targeted by a spell at all. An effect like crackling lightning is obvious, but a more subtle effect, such as an attempt to read a creature’s thoughts, typically goes unnoticed, unless a spell says otherwise.
Rules designer Jeremy Crawford further reiterates this in a tweet:
You know that a creature/object/space is affected by a spell only if the spell's effects are visible, you witnessed the spell being cast on the target, or you've otherwise detected/discerned the presence of the spell's effects.
Hex and many other spells don't have a perceptible effect, so by default the target doesn't know if a spell has been cast on them, except if they see your somatic or material component or hear your verbal component. Even if they see/hear you, they don't know what spell you cast. It depends on the DM, though, how they rule how loud and obvious a spell's somatic and verbal components are.
So, if you are trying to safely curse a neutral or friendly target before combat, your DM might allow you to do that. However, they might notice that you are casting a spell, so they become suspicious and start attacking, anyway. To hide your casting, you can use the sorcerer's Subtle Spell metamagic (but you still need to use your arcane focus if the spell has a material component), or hide your hand - which then your DM might call for a Sleight of Hand check.
If you are trying to tame an already hostile creature and debuff them, you can use charm person or charm monster instead of friends.