Let’s get down to brass tacks.
With the Arduino IDE, you can use Serial prints to debug, but it’s a bit like using a flashlight to explore a cave.
Arduino does not have a built-in testing framework like some other programming environments.