You may try with WhenEvent
. For example, this gives a solution which becomes negative:
NDSolveValue[{y'[x] == Sqrt[Abs[y[x]]], y[1] == 1}, y, {x, -5, 3}]
but we can pick the nonnegative solution with this:
NDSolveValue[{y'[x] == Sqrt[Abs[y[x]]], y[1] == 1,
WhenEvent[y[x] < 0, y[x] -> 0]},
y, {x, -5, 1}]