1. We have to protect the environment from pollution.

2. We have to protect environment from pollution.
[Do we have to put 'the ' before environment or not? Are both okay?]

Yes, you need “the” before “environment.”

Both sentences are grammatically correct, but they have slightly different meanings.

In the first sentence, "We have to protect the environment from pollution," using "the" before "environment" implies that there is a specific, identifiable environment that the speaker is referring to. It suggests that there is a shared understanding between the speaker and the listener about which environment is being discussed.

In the second sentence, "We have to protect environment from pollution," omitting "the" before "environment" suggests a more general, broad statement about protecting any environment from pollution. It does not specify which environment is being referred to, making it a more general statement.

To decide which version to use, consider the context and the specific environment you are referring to. If you are talking about a particular environment that is known and specified, it is appropriate to use "the" before "environment." If you are making a general statement about protecting any environment, you can omit "the" before "environment."