Let me share a mistake I made myself: I didn’t understand this back then.
A hash function converts data of any length into an output of fixed length. This output is called a hash value, or a digest.
Hashing is not encryption: encrypted data can be recovered with a key, but hashing is one-way—you can’t recover the original content from the hash value.
Mining $BTC is essentially calculating SHA-256 hashes over and over to find a result that meets the difficulty requirement.
If anything is unclear, ask me in the comments.