Formal methods refer to mathematically-based techniques used for specifying, developing, and verifying software and hardware systems. These methods provide a rigorous framework that helps ensure correctness, reliability, and robustness in computer programs and systems by employing logic and formal languages.