Welcome to the forum!
Generally, it's better to avoid the early religious techs. The big priority in the opening is growing your economy as fast as possible; getting faster pastures or faster gold mines will have a much bigger impact on your game 90% of the time than founding a religion will. You certainly want at least one strategic resource (copper, iron, or horses), but any one of those will work fine.
Iron Working is expensive (and usually fairly easy to trade for from the AI), so most people avoid it unless they are in the jungle, or are planning on rushing swords or rushing crossbows. Chariots will do fine for barbarian defense; horse archers are a strong offensive option until longbows start becoming too numerous.
You definitely want one military unit in each city. If you feel particularly nervous about a city, you might give it a 2- or 3- archer/longbow garrison, but that should be the exception and not the rule. If you're in the Hereditary Rule civic, you'll want to garrison more units in cities to raise happy cap; at least 2-3 units in your major cities, and it's fine to go up to 5 or more units (you want to garrison units to raise the happy cap enough to work all the good tiles if you can, or enough to make use of surplus food by growing steadily if you have a ton of good tiles). Beyond that, you want to have just one big stack; how you split it up in peacetime depends on where you think threats will come from (your first move if someone attacks you is to gather that stack all in one place to meet their army and crush it). How much of a stack you need varies wildly based on your neighbors and diplomatic situation.
The AIs all have their own personalities - there are unit spammers, religious zealots, psychopaths, backstabbers, pacifists, wonder spammers, isolationists, and more. Depending on which AIs you're bordering, how the religions are breaking down, and what wars have already happened / are currently happening, you often don't need any defensive army. Sometimes it's prudent to keep a few archers in border cities as a garrison, and sometimes you want to start planning for a nearly-inevitable war (in which case you're getting a respectable army, with the intention of using it offensively if the expected AI attack doesn't come before the army is ready).
If you are
regularly getting killed by an AI attacking you, the most likely problems are poor diplomacy and/or poor management of your empire, not a lack of military. Most games, proper diplomacy can keep you from ever being attacked. When it doesn't, most of the time you can whip + chop + otherwise rush out an army really quickly from all your cities which is strong enough to at least hold off the AI, if not outright defeat their army and take the offensive.