Draw snapping lines

Hi all. I’m new to Unity and I have no coding experience. I want to draw lines in my game, with the mouse or fingers, so that they snap into objects in the scene. The problem is: the line has to be between two points, horizontally or vertically oriented, not diagonally. Anything will do, even if you have to make these dots become buttons to make it easy.
Another thing. It gotta be a prefab. Not a raycast or trail
It is a turn based board game where you connect dots in a matrix, but I want one player to be able to destroy the other player lines, and also, player 1 draws color 1 or prefab 1, tag 1, and p2 draws color 2, and so on, so that the game knows what line to destroy (although it could destroy my own too, whatever works, I’m creating this from scratch).
Think about a square where you draw the lines, not allowing the player to cheat and do two lines at once or draw a diagonal.

Have you found the answer?