I've struggled with balance at times.
Firstly - as people have recommended - practice balancing. Sit on your stool for a few minutes, holding your legs up (but not tucked under the stool!) its really hard. Do it first thing when you sit down to practice every time just even for 30 seconds to start with. You'll start seeing results soon. You'll be able to hold it longer and longer. This will help your balance, your position, your leg strength and your core strength.
Secondly - working on your core muscles might be key. I had a car accident many years ago, and while in physio it was highlighted to me how shockingly weak my core was. Since then I've worked on it to varying levels over the years, but since getting back into drums over lockdown, I've become very aware that there are times when I'm drumming for a while, including lots of double kicks, then sometimes my whole lower abdomen is just rigid with tensed muscles, but I'm balanced, I'm firmly placed on the stool and all four limbs can do what they like (as far as my ability allows!). I was not able to do this when I drummed in my teens, pre accident, and pre working on my core muscles. Doesn't even take much, if this were the problem just do like 20 sit ups a day, or 10 if you can only do 10 to start with. I tend to do about 40 each morning so just a couple of minutes, and that's it for core muscle stuff, but I'm glad I do when I'm drumming. Plus, you get great abs!
Thirdly - maybe not the best advice, but it worked for me, ignore the problem and it'll go away! I've been working on a piece for the last year or so, writing it above my ability and learning to play it, up to speed. I've noticed without putting specific work into it, that the patterns that caused most loss of balance have now just become easier. There was one where I was going from double kicks to the hat and kick and I kept nearly falling off the stool. Without addressing the problem, just practicing what I wanted to practice, my body learnt how to do it with less falling over! I think it's in the position I sit on the stool, but I don't really know, it just isn't a problem anymore where once it was. Your body will adapt, so where it isn't a very specific technique that you have to get right, I'd almost say worry about things that do need that level of attention, and stuff like this will just sink in.