Can I use raycast to make a laser effect?

Can a raycast be made visible in the actual game and not just in the editor?

Unity make this comment -

Note: This is for debugging playmode only. Editor gizmos should be drawn with Gizmos.Drawline or Handles.DrawLine instead.

which if I’ve understood means that raycast can only be used for debugging uses?

You can use the LineRenderer to display in game