Drawing a Line When clicking a checkbox?

Hi Everyone,
I am new to Unity and trying to figure out how to create a line when clicking a button or checking a checkbox. So, for instance, let’s say that I am creating a map. Now, I would like to check a checkbox or a radio button which creates a path (line) from point A to point B. Hope this clarifies hat I am looking for.
I really would appreciate if someone would walk me through this.
Thank you!

You would want to use LineRenderer for this


You can set a lot of options for how you want it to look and have multiple points for the line for a more complex path.

Thank you for your response, however how to function a checkbox or a event button to trigger the line to be created.