Package Ending Reminders

Hello, is there a way to set up an automation or to send email reminders to clients when:
A) They’re halfway / 2 sessions away from the package they signed up for?
B) They’re halfway / 2 weeks away from the program they signed up for?

Like a “Hey, you’ve got 2 sessions left. Great time to start thinking whether you want to pause, re-start or keep going.” Or something like that…

Thanks community!