Jus cogens is Latin for "peremptory law", or "the law that compels". This is a basic principle in Public International Law, describing a law that can't be derogated or violated; not even through a treaty of mutual agreement between two states, a state and an organization, or any other subjects of Public International Law.
The concept is derived from the importance the law or norm possesses; usually derived, again, from laws concerning human rights, like the abolishment of slavery, prohibition of torture, genocide, regulation of war crimes, and crimes against the environment. The Vienna Convention of Law Treaties has stated that if any clause or principle stated in any treaty contravenes or violates any jus cogens, this treaty would be considered void. Now, how can we recognize jus cogens? Outside of the article of the Vienna Convention I mentioned before, it's usually determined, like every other law in Public International Law, through a consensus of states and international custom.
Of course, this being Public International Law, it means most states (yet not every) have accepted and ratified the Vienna Convention, while others have merely taken it as a most reasonable suggestion. While the definition of jus cogens would appear to be universal, some states have too taken the prerogative of defining on their own the interpretation of these peremptory laws.