How could you create a line between two points in 2D?

The solution can’t include Debug.DrawLine for the purpose of the project. Needs to be a simple solution.

You can use Linerenderer in 2D also

You can have some help from here : Line renderer 2D not visible