Pretty much all of the encryption software in use on the internet takes advantage of a trapdoor function - you can multiply 2 numbers together but you can’t easily determine what the 2 factors were if all you have is the resulting product. As it is today the only way most of us know to do it is to try every number. If someone were to figure out a better way that took less time, it would make it easy for a regular guy like me to use that method in some software to decrypt HTTPS traffic and such.
Hashing is slightly different but the idea is the same - it is not possible to work the hash in reverse to determine what the possible inputs were, you just have to try every plausible input and compare your hash.
None of these things are perfect but bitcoin is only taking advantage of existing methods that are in use by a lot of other software which has been accepted for a long time. If a basic flaw is found, bitcoin is probably the least of anyone’s worries 😊