This quote means that when someone is desperate, they are willing to take drastic steps to change their situation. The only way to escape from a difficult situation is by being willing to leave behind any beliefs or values that were preventing them from making a change. In other words, embracing change–even something that might be considered extreme–is often the only way to get out of a difficult situation.