On which machine thus the instance launched? (ubuntu or Amazon Linux)?
1. If you are using ubuntu machine instance then the command is:
ssh -i <keypair.pem> ubuntu@<public Ip address of instance>
2. If in case you are using on Amazon Linux then the command is:
ssh -i <keypair.pem> ec2-user@<public ip address of instance>
3. If you are launching the instance for the first time it will ask us whether to add this key pair to the system or not? please enter yes and then continue it.
4. If still doesn't work try copying the key pair folder to the outer directory and try ssh command from there.
Note: Remove the quotations while giving the .pem file name.