Even thinking through the code is not complete because our brains make mistakes. They also make assumptions, thousands of them, that you don’t know about. It’s tricky, because every thought you have has an entire sea of preconceived notions and knowledge behind it, which you can’t identify. In that way, it’s similar to an LLM.
In practice, for code, testing code is the way to go. Formal proofs work, too, but the barrier to entry is high and it’s overkill for most business applications. LLMs can be very good at writing tests, if you read the test thoroughly and analyze them.