The main reason Austria-Hungary declared war on Serbia was:
B) Austria-Hungary believed Serbia was involved in the assassination of Archduke Franz Ferdinand.
The assassination of Archduke Franz Ferdinand on June 28, 1914, was a key event that triggered the war. Austria-Hungary viewed Serbia as complicit in the assassination, leading them to present an ultimatum to Serbia, which escalated into a declaration of war.