A hash takes any-sized input (a file, a password, a million-line document) and outputs a fixed-length string. Same input → same hash. Tiny change in input → completely different hash.
It's one-way: you can't recover the original from the hash. That's the point. Cryptographic hashes (SHA-256, SHA-512) are also designed so it's infeasible to find two inputs with the same hash.
Use it for: file integrity (checksums), deduplication, content-addressed storage, signing data. For passwords, use a slow hash like bcrypt or Argon2, never SHA-256 directly.