US President Donald Trump pulled out of a deal to help developing nations fight climate change, laying the groundwork to withdraw much-needed support as extreme weather gets worse.