Lifecycle configuration are the most cost-effective strategies when your objects follow predictable patterns of usage.
Some examples are,
delete older versions of your objects
clean up incomplete multipart uploads
deleting data after some time
moving it to Archival Storage if you don't need the object to be accessible all the time, but you have to keep it for longer times to comply with some regulation.
In lifecycle management there are 2 types of actions: Transition and Expiration:
supported transitions
Lifecycle configurations are written in XML.
Check this example of a configuration where all the files matching a prefix are moved to S3 Glacier after 90 days and after 1 year are being deleted entirely: