It's essential to have good eating habits.

Literal

Good eating-habits [object-を] have [nominalizer-こと-が] indispensable thing [copula-である].

不可欠 ('indispensable, essential') is a formal な-adjective — 不 ('not') + 可 ('able') + 欠 ('lack') = 'unable to lack' = 'essential.' 食習慣 ('eating habits'). The cleft ~ことが~である construction marks the essentiality.