You can use your AirPods to control Spotify when they are connected to the iPhone or iPad running iOS 13 or higher and with the latest version of the Spotify app.
Unlike the older method using Siri Shortcuts, this is very reliable and built-in to the Spotify app and into iOS 13. You need to allow Siri to access your Spotify data the first time, and then you can just ask Siri to play "in Spotify" and all should work.
Here are the commands that you can use with Siri and Spotify;
Here's more on how Siri and Spotify work together if you still need help.
This article may contain affiliate links. Click here for more details.