Defense is a complex topic.
You realistically have 4 options for protecting your ship, and they depend on the ship and how you fit it in station before you undock:
Fast speed and/or small size.
Big weapons are designed to do very little damage or even not be able to hit small ships, or ships that can go faster than the weapon’s ability to track them. This defense is used by frigates, and it was specifically put in the game to give frigates a chance to go against big ships. You can get a feel for the difference size / speed make when you go from frigate to destroyer; the destroyer has the same shields and armor as a frigate, but greatly increased size and lower speed, and will take full damage from big ships, in situations where a frigate will take 50% damage or less.
Shield defenses.
Because shields regenerate (although slowly), you have choices. You can either pump energy into the shield and replenish it (using a shield booster module), or you can enhance the shield’s natural regeneration rate and add so many resistances that it’s able to keep up with damage in combat. For active shield repair you use mid slots to install active shield modules, and for the passive shield regeneration you will use mid slots to install extra shields and shield resistances, AND low slots to increase the regeneration rate.
Armor defenses.
Armor must be repaired, so you need to use the ship’s low slots to install repairers and resistance modules. The armor repairers use a lot of capacitor energy.
Range / jamming / avoidance.
The final option is to simply avoid damage altogether and stay out of range, or jam the enemy’s targeting or weapons so they can’t do damage. For this, you need a good “propulsion” module (afterburner, microwarp drive MWD, microjumpdrive MJD) to control your range, or you need friends with ships that can jam the enemy (jamming also uses mid slots) so they can’t even target, much less shoot. And you need weapons that can do damage to the enemy at the long range that you’re staying at.
There are a few “you’re joking, right?” options for defense, and they exist because of quirks of the game:
Buffer tank.
You simply add as many hitpoints and resistances as possible to your armor OR shields, and go without any means to repair them. This relies on the assumption that the fight will be over before you run out, like for example in high-sec where you can expect Concord to come to your rescue within 30 seconds. Or, for example, if you have logistics ships (healers) in your fleet, that can repair you better than you can repair yourself.
Hull tank.
To answer your initial question, the hull of the ship is basically the last layer before your ship explodes. If you lose your primary defense (the shields or the armor that you could repair), you’re supposed to abandon all hope and focus on GTFO, escaping the situation, and the point of the hull is to give you time to align your ship to an escape vector and get out. If you look at the hull repair modules, they do use low slots, but they don’t come anywhere near being able to repair the amounts of damage you’ll suffer in combat. Hull repair is more an option to avoid paying repair fees at a station; just strap a module on and wait until it’s quiet to undock and bandage your ship at the slow rate of “it’ll take all night”.
Spider tank.
The first thing a fleet will do to you is concentrate all their weapons on you, so you have no chance. The enemy fleet commander (FC) calls you as the primary target, and everyone shoots you. Focus fire, it’s a basic tactic. How do you deal with that? Well, everybody in YOUR fleet has to remote-repair you, and hopefully the love from your friends matches the hatred from the enemy. So when they give up on trying to take you down, and switch over to your friend in the next ship, YOU and everyone else in your fleet switch over to repair them.
Can’t catch me.
First, you pick a ship that’s very agile to begin with, like an interceptor or basic frigate, and then you enhance its agility (how fast it can reorient itself to warp away) to ridiculous levels, making it faster (at going away into warp) than the game server can reasonably react given the “1-second per round” rule that it has for its processors, and the approx. 1 second delay for data traveling over the Internet. So this basically lets you travel like The Flash. Of course, to counter this, the enemy can set up their interceptors to target and warp-disrupt you faster than the server can react too, and then the situation becomes a coin toss, purely chance.