Rotate cube side parallel to side of another cube

I need help.

I have a cube. It has random rotation on start. When I click to it side (let it be SIDE A), I add new cube. New cube has special side (SIDE B with yellow cone). I need to rotate new cube SIDE B parallel to SIDE A. I have normals to both sides, rotation of yellow cone, but I can’t understand how to do this rotation.

Please help