How to send email if task fails on something or any particular condition? I

You have several options, depending on the scope:

- mail task (trigger when: yum_update is failed/ task in rescue/always
part of a block, disk_usage > 75, etc)
https://docs.ansible.com/ansible/5/collections/community/general/mail_module.html
- mail callback (handles any failures in run)
https://docs.ansible.com/ansible/latest/collections/community/general/mail_callback.html#ansible-collections-community-general-mail-callback