When i draw the lines pass on

imagine i draw at the bottom of the canvas but i accidentally go off the canvas. well these lines pass on the the top of the canvas… how can i disable this?

This sounds a bit like wrap around mode maybe
Test this:
In the top bar go to:
View -> Wrap Around Mode

If this does not help, maybe share a video of the problem?