Compartmentalize things so they all handle one thing individually and then you call those things from a main class is generally the way you’d do it.
Splitting things up will make your classes specific to a certain functionality and allow you to keep track of everything without individual files being thousands of lines, though sometimes they will end up that way anyway to achieve a single piece of functionality.
So for example you might have a service to call the api to get data, a service that exclusively posts to mastodon, etc.
You can write 500 lines of code to do something in your service and hide it away but then just call it like petInfoService.getPetInfo() from your main class and when you look at the flow it’ll make a lot more sense.
Any reason you chose typescript out of curiosity? Nothing wrong with it, just curious.
Feel free to post code if you need help. Just make sure whatever you’re posting or uploading to git doesn’t include any API keys.