EC2 is a hosted cloud-based machine while S3 is related to the storage services. So, both are essential services and in case you are using EC2 then there are chances that you will also need S3 going further.
EC2 is majorly used for hosting websites and web applications over cloud. In case of S3 it is highly useful for storing data and managing it in a systematic way for the websites or web applications.
S3 data buckets can be used to backup the data of from the EC2 instances. It is one of the major use cases among various other that you can consider while implementing the services.
As S3 data buckets can be seamlessly accessed by multiple EC2 instances it can be a useful solution for sharing data between the various instances.