Can't delete/edit the water outside

Hi,

I would like to remove the water on the sides, its going outside the river and I really can’t find how do I remove the water going outside my river.

Here is what I mean
Screenshot, 2021-12-05 18:48:11 - Paste.Pics

I would like the water not to go outside the river, like in this tutorial for example.

Please help me, I tryed to figure it out the whole day.