Your relationship with the united nations becoming critical, is the result of "evil" actions, such as declaring war, or researching technologies such as nuclear weapons.
Your relations can suffer if you go to war without the necessary justification, or of you research so called "bad" technologies. Such as nuclear weapons or propaganda machine.
What effect dose it have?
If you lose your membership of the united nations, you can not re-gain it later in game, and you also loose the trade bonus from the UN ratings, as well as the potential efficiency bonus to your military, if you have been given military advisers from the UN.
Sometimes the UN will also offer you AID, usually only if you need it, but sometimes also when you do not.
How can you improve your relations
Improving your relationship with the UN, after it having become critical, takes time. But it can be done by completing lots of trades with other nations. And perhaps also by researching technologies that are "liked" by the world.
You can try to create new treaties with other nations, and to send them gifts. But keep in mind that it takes time. Its better you focus on other parts of the gameplay, while you passively work to improve your relations.
How can you avoid that it becomes critical?
As many of you may already have noticed, very early, declaring war with nations that you only have little casus belli against, will either get your membership withdrawn, or make your UN relations become critical. So avoiding going to war with such nations, will allow you to avoid negative consequences.
In addition, avoiding the research of so called "bad" technologies, may help you to avoid that your UN relations suffer.
If you lose a democratic election, and become a dictatorship through military force – which may be quite fun – your UN relations will suffer a little as a result.