An AWS instance is a virtual machine that runs its own operating system (there are several options for this), you connect to that virtual machine through a ssh connection that opens a system terminal, and there you have to type those commands.
Those commands could be a little different depending on the Linux version that the aws instance is running, that is why I'm asking you.