… is from page 620 of the 1988 collection of Lord Acton’s writings (edited by the late J. Rufus Fears), Essays in Religion, Politics, and Morality ; specifically, it’s a note drawn from Acton’s extensive papers at Cambridge University; (I can find no date for this passage):
History is not a master but a teacher. It is full of evil. It is addressed to free men who choose among its examples. Like experimental science – in which many unsuccessful experiments prepare the way to discovery.