trusting in this and remembering the days when he was only a shepherd boy , how god had helped and sustained him when troubles arose , he once again turned his heart thereto , and encouraged himself in the lord .