Both A's are correct English (apart from the missing full stops), and both B's are incorrect. "careful to" always needs a verb infinitive.
However, "Be careful to bake cakes" seems an unusual thing to say. "Be careful to..." normally implies that not doing that thing is a mistake, or disadvantageous, or dangerous, or something like that. Baking cakes does not normally fall into that categ