There's a persistent idea that hacking is some arcane trick. Mostly it isn't. A great deal of what gets called hacking is simply obtaining information — a reused password, a leaked credential list, a security question answer someone mentioned in passing — and then using it.
Which is also why the practical defence is boring: unique passwords per site, two-factor authentication, and not reusing anything important.
And to be clear about the other half of the question: breaking into someone else's account is illegal in most jurisdictions and a genuine harm to a real person, not a victimless prank. If you're curious about security as a subject, that curiosity has an entirely legal outlet — capture-the-flag challenges, deliberately vulnerable practice apps and the wider security research community.