Want to clear tag in Firebase after a time

Add Details about what you want to discuss…
I have an educational app and i am selling a course when payment complete then firebase store 1 but after 365 days i want to remove the tag from firebase so what can I do for it.
Block Images(if Any)

AIA OR APK(if Any)

if(purchase date + 365 days > today’s date){
Subscription expired.
Subscription activated.

How i choose date