The YDlidar is cheap and comes with some software for PC.
Sorry the discription is in dutch, but the software usually is evident.
For PC i used the usb-board, when i us a microcontroller (raspberry pi, esp or Arduino) I connect directly. For esp and Arduino i also use a software serial connection to the PC for debugging. Software can be extended (actions if distance to small). Watch out the Arduino is only just quick enough (or mayby just nog quick enough)