How to replace a word or a content in a file using ansible.

I am trying to replace a word in file using Ansible.

Any inputs how to acheive it.

Use replace module.

https://docs.ansible.com/ansible/2.3/replace_module.html