Most store bought sauerkraut is pasteurized and when the store bought sauerkraut goes through the pasteurization process the sauerkraut is heated up to a temperature that kills off bacteria.
That pasteurization and heat also kills off the good bacteria so for the store bought sauerkraut it's not really a probiotic.
The best and healthiest sauerkraut is homemade sauerkraut that you ferment at home which then is not pasteurized and so it contains the good bacteria that makes the sauerkraut healthy.
It's pretty easy to make homemade sauerkraut and there are recipes and instructions online as well as Youtube videos showing how to make homemade sauerkraut.
You don't cook the sauerkraut but instead ferment it for several days until it's ready to eat.