When circumstances or a situation works against you, you face adversity.
Adversity, a noun which has been part of the English language for over 800 years, comes from the Latin adversitatem "opposition" and is related to the preposition, versus, a word common in legal or battle language meaning "against." When things seem against you — circumstances or a stoke of bad luck — you are facing adversity. Sometimes people use a form of the phrase, "turning adversity into opportunity/advantage." This refers to the ability some people or companies have to take a bad situation and make it into a successful one.