You can auto assign a public IP address when you launch a new EC2 instance.
But if you didn't and you want to assign one after launched, you can use Elastic IP address (EIP) to achieve that.
Then need to check EC2 Security Group
Then check NACL associated with subnet:
THen check the Route table: