Voltaire said this quote

It is proved...that things cannot be other than they are, for since everything was made for a purpose, it follows that everything is made for the best purpose.