What is the grammatical name and function of "The variety of vitamins and nutrients in green beans" help prevent many health problems
In English grammar there are two main parts of a sentence: the subject and the predicate.
The subject usually appears before the predicate to show what the sentence is about, or who or what performs the action.
The subject of a sentence may be one word or several words. Commonly it is a noun, a pronoun, or a noun phrase. Sometimes it can be even an entire clause:
What he had already forgotten about computer repair could fill whole volumes.
In your example:
The variety of vitamins and nutrients in green beans helps prevent many health problems.
the part in bold is a noun phrase that functions as the subject of the sentence.