How AI can help solve some of humanity's greatest challenges – and why we might fail