I know it sounds ridiculous but I just need someone to help me clear some things up.
When archduke Franz Ferdinand was assassinated in Sarajevo, the Austro-Hungarian empire was ruling over Bosnia. Technically speaking, the war should've been Austro-Hungarian empire vs Bosnia? Why were Germany and France involved in the first place? I understand that Germany was allied with the Austro-Hungarian empire but it doesn't explain why they decided to invade Belgium and ultimately start WWI... I'm a bit lost.
Hello friend! I made a large post detailing why Germany is both responsible for the war and why they were involved, therefore. Hopefully this should provide some insight.
Not so TL;DR:
Note: "w.r.t." = with respect to. I'll be using it a lot.
Germany forms in 1871. There are 5 great powers in Europe (Britain, Germany, France, Russia, Austria-Hungary). Bismark's strategy, due to Germany's encirclement (hence vulnerable position) to Great Powers was to keep 2 out of the 4 on his side (hence the 3/5th's rule). He achieved this through creating a defensive alliance w.r.t. Russia with Austria-Hungary and creating a non-aggression treaty with Russia. Britain was isolationist w.r.t. continental politics so they were a non-issue.
These treaties fall through. France, who was previously isolated, now finds a friend in a Russia who had an aggressive Austria-Hungary to the South and no ally in Germany and an enemy in Britain. France and Russia sign a defense treaty w.r.t. Germany. Britain is still more or less isolated from continental politics, Austria-Hungary is making claims in the Balkans to suppress the Slavs in particular (whom Russia feels they are a protector of) and thus they are conflicting there.
Germany begins rapid naval buildup. With Russia/France vs Germany/Austria-Hungary they want to force Britain into the fold. They hope that their shared cultural/ethnic heritage and a show of naval might would make Britain think an alliance was better than contention. It has the exact opposite effect. Britain would not let up naval hegemony, especially when Germany's navy directly threatened their home islands. A naval race ensues between Britain and Germany.
France and Britain sign a treaty recognizing each others territorial claims in North Africa. Germany undermines this treaty by calling for the Sultan of Morocco (under French rule w.r.t. the agreement) to revolt and then calling for a European conference to call for the fate of Morocco. Britain is pissed that Germany is meddling in their business. All of Europe, even Germany's ally Italy and Britian's enemy Russia, with the exception of A-H, side with France. The world looks more cautiously at Germany.
After Russia loses to Japan in 1905 her Eastern frontiers are more or less settled with Japan. In 1907, some say because of their common fear of Germany (Russia would lose her ports in the Baltic b/c of German naval buildup), Britain and Russia make friends and settle their Central Asian territorial disputes. The foundation for 'The Triple Entente' is now born -- Britain wanted to help France but to do that she needed to make friends with Russia and that's what happened. Moreover with all her frontiers settled Russia could throw all of her weight into Europe, her Westerly border.
Second Moroccan Crisis. Germany sends a warship to intervene with a French suppression of a Moroccan revolt. Germany would seize a sizable amount of French territory in sub-equatorial Africa to integrate into the colony of Kamerun and would in return recognize French control over Morocco. It was a bluff, in essence, that worked but united the former Entente against Germany. Britain was pissed off about Germany trying to be a naval power and fucking with France, Russia was pissed for obvious reasons (friends with A-H, naval buildup in the Baltic), and France was just pissed off in general.
Actual TL;DR:
Germany wanted to seize European power and did it through a policy called Weltpolitik which was denoted by aggressive world policy and militarism. Through this policy they attempted to bring Britain into the fold but in fact alienated them right into France's arms and did seize colonies in the short term but in the process further solidified the lines of the growing power blocs.
Once Austria-Hungary invaded Serbia, Russia went to defend Serbia. They didn't declare war, just mobilized. Germany in response told Russia to stop mobilizing or war. They didn't stop mobilizing so Germany declared war, as per her treaty with Austria-Hungary. However declaring war on Russia meant France was coming in too. So the plan was to throw everything West, knock out France in 40 days, and then swing everything East after the Russians finish their mobilization (which was expected to take a significant amount of time). The plan to do this was developed in 1905 and called the Schlieffen Plan -- a rapid invasion through Belgium meant to strike at Paris and encircle the French armies who would be pushing into the border of Germany. Basically a 'swinging door', French invade Germany, Germany goes around, hits them from behind.
It was less "You're invading Serbia Austria-Hungary, our ally, so now we will invade France for no reason!" Germany created, through its policy of Weltpolitik, two power blocs on continental Europe. When it was clear Austria-Hungary and Russia were going toe to toe that meant both of their blocs were going in with them. Germany pre-emptively struck France via Belgium to hit them before they came in.
Now for your other thing, you're mixing up terms a bit.
When archduke Franz Ferdinand was assassinated in Sarajevo, the Austro-Hungarian empire was ruling over Bosnia. Technically speaking, the war should've been Austro-Hungarian empire vs Bosnia?
There was no war with Bosnia, Bosnia was under Austro-Hungarian rule. Basically the Austro-Hungarian empire believed Serbia was behind it (modern scholarship shows Serbia was actually less connected with the Black Hand than we thought -- the connection between the two was years old at the time of the assassination). This was, well, flat out a power grab regardless if Serbia was actually behind the assassination.
Basically Austria-Hungary was made up of much more than Austrians or Hungarians. Croatians, Slovenes, Bosnians, and Rumanians made up a significant amount of the population and the former 3 were particularly feisty. There was much call for separation from the Empire and to unite with Serbia into a greater pan-Slavic union in the Balkans. Austria-Hungary hoped that through war, and by crushing Serbia, they could also crush these dreams. Their empire was falling apart from the inside and this was their only chance to maintain it without making significant losses to Slavic demands.
Further reading:
The First World War: Volume I: To Arms by Hew Strachan
Sleepwalkers: How Europe Went to War in 1914 by Christopher Clark
The First World War: Germany and Austria-Hungary, 1914-1918 by Holger Herwig
At first it indeed was just a war between Austria and Serbia (Bosnia was part of Austrian territory). This was fuel for conflict with Russia though as they didn't want to lose their last ally and influence in the region. A big problem of the time were the big misconceptions the country's leaders had about a modern war. Before the war started and even a few months into it, pretty much all factions believed in a victory until Christmas. As wars in the past often lasted only a few months. This was as it turned out far from true. Modern artillery especially changed the face of warfare.
So basically Germany thought that they would just quickly defeat France like they did in the 1870/71 war 40 years prior and then concentrate their forces eastwards. They wanted to achieve this via the Schlieffen-Plan which meant invading Belgium and attack France this way, as the French had good defensive lines at their border to Germany.
This channel should cover everything. And get more into detail. http://youtu.be/6FgaL0xIazk
Edit: Added a proper answer on request of a mod.