How to create an effect that fades in and out?

How can you create an effect that fades in and then out when nearing the end of it’s lifetime?