Although it's impossible to know precisely how the world will end, some possible scenarios include nuclear war, a super virus or spontaneously replicating nanotechnology. Most of the scenarios would either directly kill most humans or indirectly kill them by rendering the planet uninhabitable.
Although a nuclear apocalypse is no longer the threat that it once was during the Cold War, numerous countries still possess functioning nuclear warheads. Even a single nuclear blast could be enough to cause a nuclear winter. This would cause nuclear debris to block out the sun and lower the Earth's temperature, resulting in widespread death. Nuclear particles in the atmosphere could also poison crops and water supplies.
Another possibility is a highly virulent, antibiotic-resistant virus. Viruses are frequently mutating, producing new strains of disease that are resistant to modern medicine. Many public health experts claim that a global pandemic brought on by a newly evolved virus has the potential to decimate human life.
Another possible scenario could emerge from nanotechnology. Microscopic nanotech machines are robots that can be far smaller than the diameter of a human hair. Scientists are already experimenting with alternative fuel sources for these machines, but if nanotechnology gains the ability to spontaneously self replicate, it could prove disastrous for humans. Nanotech machines might find organic matter to be a viable fuel source, whether it's water, trees or even humans themselves.