I am trying to decide if the infinitive phrase is used as a noun an adjective or an adverb.

To have a balanced diet, keep the food triangle in mind.

Is this an adverb that describes how to keep the food?

What about this one?
Fifty years ago, people didn't know to avoid "bad" cholesterol.

Is this a noun because it is a direct object

I agree with both of your answers.

I am stuck on this one.

Would you like to read this detective novel?

I am torn between adjective and noun. Noun because it is a direct object or adjective because it describes you?

And this one.
My grandmother taught me to make lentil soup.

I am thinking adverb because it describes what she taught or noun because it is a direct object?

Both are nouns, used as direct objects.

To determine how an infinitive phrase is used in a sentence (as a noun, adjective, or adverb), you need to understand its function and the context of the sentence.

In the first example, "To have a balanced diet" is the infinitive phrase. It is used as an adverbial phrase because it provides additional information about the verb "keep." It answers the question of "how" to keep the food triangle in mind. So yes, in this case, the infinitive phrase is an adverb that describes how to keep the food.

In the second example, "to avoid 'bad' cholesterol" is the infinitive phrase. It is used as a noun phrase, specifically as a direct object. It answers the question of "what" people didn't know. The complete sentence is "people didn't know what?" and the answer is "to avoid 'bad' cholesterol." Therefore, the infinitive phrase functions as a noun in this case.