Sam's LinkedIn password was compromised when it was leaked in a data breach. He realized he was using the same weak password across multiple accounts. To protect himself, Sam changed his passwords to be long, complex, and unique for each account. He also enabled additional security measures like two-factor authentication and notified others about the breach.