In this sentence, "as best they could" is an idiomatic phrase that means "to the best of their ability" or "in the best way possible for them." It's a common expression used to indicate that people are doing their utmost given the circumstances.