What is the main purpose of an IAM Role?

How do IAM Roles differ from IAM Users?

What is an IAM Role?

Can an EC2 instance in a public subnet access an S3 bucket using an IAM role?

How to map IAM role to EC2 instance?