The first world war started when Austria declared war on Serbia. Russia, an ally of Serbia, declared war on Austria. Germany was Austria’s ally and followed suit in declaring war against Russia. Since Russia was a British and French ally, the latter two declared war on Germany. This chain of events started World War I.
The reason why Austria declared war on Serbia was because the heir to the Austrian throne was assassinated by a Serbian nationalist. Although Serbia vehemently declared that they had nothing to do with the Serb nationalist and his assaination, Austria got its casus belli to declare war. It sought any opportunity to destroy its Balkan rival.
For further reading check the following articles: