When a film takes place over the course of many years or during multiple timelines, filmmakers have two choices: cast a different actor or use makeup and CGI to make an actor look younger or older.
It's honestly super impressive, so for your viewing pleasure, I have compiled examples from films where visual effects and makeup teams made actors look wayyyy older or younger.