Which is better to use baking soda or baking powder for making cakes?
They are different ingredients and one does not replace the other. Baking soda is an alkali which can react with acidic ingredients in a recipe to produce carbon dioxide which helps baked goods rise. Baking powder includes baking soda (or similar) and an acidic ingredient, so it is more 'self-contained' rather than relying on something else in the recipe. (Self-raising flour is basically flour with baking powder mixed in, to be even more self-contained.)
But you should just follow whatever is in the recipe you are making or adapting. If you have found a recipe you are trying to follow which does not make it clear you could post it in your question and we could try to work it out from the other ingredients.