Newbie Question - Ansible Engine required

I have not yet written any ansible plays, playbooks - code in general.

If I write some ansible code, do I necessarily require an Ansible Engine, or Ansible Tower, or can I simply copy the playbooks (those are the files full of code right) and then execute them with:

ansible-playbook myplaybook.yml

with the understanding that a host specified within the file “myplaybook.yml” is identified within the /etc/ansible/hosts file? Correct?

So, I would want to use–
hosts: localhost within the file myplaybook.yml
and ensure localhost was identified in /etc/ansbile/hosts on any machine that I needed to run the plays/modules on?

Thank you,