How would I automate repetitive tasks in Android?
A great app for that is Automate. I've used it with great success. There are a few plugins that exist; you may or may not need them

The main app is here

Based on your use case, you may want this,  this and maybe this extensions but it all depends on how you use the main app