I cannot determine the approach to solve problems like this, so any help will be appreciated. I need help specifically with the third term on the right, as in the equation to be solved.
I would be grateful if someone can prove this in a detailed manner.

I think you should go and review the Gram-Schmidt method.
What the problem says is: You want a basis for the space spanned by $ U, x, v $. You can add to the basis by first computing the component of $ v $ orthogonal to $ U $, call it $ w $,then the component of $ x $ orthogonal to $ U $, let's call it $ z $, and then the component of $ z $ orthogonal to the vector $ w $.