Complex sentence: Hugo must select the correct key to open a treasure chest; if he guesses incorrectly, a fence rises to imprison him.
Split into simpler sentences: Hugo must select the correct key to open a treasure chest. If he guesses wrongly, a fence rises to imprison him.