à thấy cũng tương đối dễ với MSYS2 mà :V
Tạo folder với 1 file main.cpp duy nhất ở trỏng:

Vscode phải install extension C/C++ IntelliSense, debugging, and code browsing.
Mở vscode lên, chọn File -> Open Folder (Ctrl+Shift+O)

Select folder vừa tạo có 1 file main.cpp ở trỏng:
Qua cột Explorer, nhấp đúp vào main.cpp để mở file main.cpp
lên.


Bấm Ctrl+Shift+B ở file main.cpp để build file main.cpp, nó sẽ hiện ra:
Kéo xuống dưới cùng chọn
Ở dưới Terminal nó hiện ra vậy là ok:
Bây giờ tới phần debug :V
Trước khi debug đặt break point trong file main.cpp ở dòng 7:
(Bấm chuột trái vô bên trái dòng 7 để đặt break point)
Để bắt đầu debug, bấm vô Run and Debug 
Nó hiện ra cột này, bấm vào button Run and Debug:

Nó hiện tiếp thế này, chọn C++ (GDB/LLDB)
Nó hiện tiếp thế này, chọn g++.exe - Build and debug active file
Nó dừng ở dòng 7 là xong :V

Mấy bữa mình debug ko được sao giờ nó tự động nhận biết hết ko phải làm gì bó tay thật =]]