If your baby does not like cold apple juice, it should be heated.

That isn't really a dangling modifier because "it should be heated" comes directly after "juice."

However, to make the sentence clearer, you could say,
Apple juice should be heated if your baby doesn't like it cold.

To determine whether the original sentence contains a dangling modifier, we need to understand what a dangling modifier is and how to identify it.

A dangling modifier is a word or phrase that doesn't clearly and logically modify the intended word in a sentence. It often occurs when the subject of the modifier is missing from the sentence, resulting in ambiguity or confusion.

In the given sentence, "if your baby does not like cold apple juice" is a dependent clause that modifies the subject "it." However, the subject "it" is not explicitly stated in the sentence, which could be confusing or ambiguous. Without additional context, it is unclear what "it" is referring to.

To rephrase the sentence, you provided an improved version that clarifies the intended meaning. By placing the modifier at the beginning of the sentence and rephrasing it as "Apple juice should be heated if your baby doesn't like it cold," the subject "apple juice" is explicitly stated, making the sentence clearer and easier to understand.

In general, when encountering a potential dangling modifier, it is helpful to identify the subject the modifier is intended to modify and ensure that it is clear and logically connected to the modifier in the sentence.