Basically I have 2 3D vectors: Vector A (green) and vector B(red).

I need to calculate a third vector that is perpendicular to VectorA (green) but points in the same direction than VectorB (red). Kinda like "flattening" VectorB.
Please ask me any question to clarify or edit the question if you got it and can make it more clear, I'm completely new to 3d vectors.
EDIT
Here's another example, I added a plane perpendicular to VectorA (the white area). The resulting vector should be in that plane.

I think what you are talking about is called vector projection. In order to project b from a, you could use the formula: $$ b' = b - {b \cdot a \over a \cdot a} a $$ This can be thought of as the part of b travelling perpendicular to a.