I'm wondering if spell casting only happens after attacks and blocking has been declared or if it's just at the second main phase? I've spoken to a few players in my area, but there aren't many people around here who play, and I'm not sure I understand.
Artifacts, creatures, enchantments, lands, planeswalkers, and sorceries can be cast during your first or second main phase.
Instants, such as Lightning Bolt, can be cast during any step except for the untap step and most cleanup steps. You can cast instants after attacking but before your opponent has a chance to block. You cannot cast instants in the middle of another spell or ability resolving.
After any spell or ability resolves, the player who is currently taking a turn gets the opportunity to cast things first.
Some spells or abilities, such as Quicken, modify when you can cast things.
If you are interested in the nitty gritty details, Section 5 of the comprehensive rules, which covers "Turn Structure", has nearly 150 rules that you can read. Much of it has been condensed into this neat chart, but a lot of (situationally relevant) information has been left out.
It depends on what type of spell you are referring to. Most spells can be cast either during the first main phase of your turn (which is before combat), or during the second main phase (which is after combat). This includes creature spells, sorcery spells, enchantment spells, artifact spells, and planeswalker spells.
Instant spells, and spells with "Flash", can be cast at anytime you have priority, which can be on other players' turns, during certain parts of combat, etc.