Yes, the sentence is grammatically correct. However, it is worth noting that the phrase "the environment, living conditions, etc." appears to be a fragment as it lacks a subject and verb. If you include the complete sentence, it would provide more context for a more accurate assessment.
Regarding the second part of the sentence, "I got used to it, and you'd better get used to it," it is grammatically correct as well. However, it carries a slightly informal and commanding tone. Depending on the context and the relationship between the speaker and the listener, it may come across as direct or even confrontational.