Haha, why not study both! Jk, I’m doing this right now, but both of my courses serve as foundational prerequisites to study other things I want to study. I think to answer your question, right now I’m focused on trying to get a more firmer deeper understanding of foundational topics before I take on what I really want to study. Here’s my experience.
My area of interest is Bayesian statistics. I first started to read a well known book on the topic, only to realize I needed to brush up on some probability theory topics I had forgotten. Okay, did this, then started reading again, then I realized, to be a good Bayesian one needs to be an even better frequentist. So I decided I needed to go back and look at some mathematical statistics but at a deeper level. So I ended up putting down the Bayesian book and picking up a more rigorous foundational text in mathematical statistics that was harder than the class I took in undergrad. The material is interesting, so I can have motivation to get through it, but I know deepening my foundational skills after this book will make researching and understanding what I really want to read less painful. For statistics especially, probability theory is like the one foundational topic you should always review and reread and sharpen, because my understanding of this will determine my understanding of advanced material.
So as a long way to answer your question, study the foundational matter, as it can benefit you when you study something that builds on top of it.