'Nicely' can function as an adverb, referring to an act of politeness or civility, as well as a kind deed or gesture. It is often used in the phrase 'play nice'
a set of rules restricting one's behavior in order to be more civil and agreeable.
'nicely' can be used to refer to pleasantries and courtesies exhibited in different settings, both formal and informal. Typically, it is used in a figurative sense to imply that someone is being polite and well-mannered.
1. 'He greeted his new boss nicely and made a good impression.'
2. 'She apologized nicely for being late.'
3. 'I thanked him nicely for his help.'
It is important to note that using 'nicely' as an adverb in this capacity should not be confused with the phrase 'not so nice,' which implies the opposite and is usually used to describe something or someone unpleasant. Additionally, it should not be confused with the adjective 'nice,' which can refer to a pleasant and agreeable thing or person, as opposed to a polite gesture or behavior.