It sounds like you are a beginner in OCaml. Basic information about building simple projects is available from
- The Dune manual Quickstart — Dune documentation
There’s also information in
- The OCaml website Get Up and Running With OCaml · OCaml Tutorials
- Real World OCaml https://dev.realworldocaml.org/
For debugging I’m afraid you will have to get used to printf
debugging (as already mentioned in Enhancing Ocaml Debugging Experience in Visual Studio Code - #2 by nojb).
Cheers,
Nicolas