grbl problem

do you need to connect arduino to your laptop before compile the code...for your information im complete beginner

No. You can compile the code even if you don't own an Arduino board. You only need to connect the Arduino board to your computer before uploading the sketch.