Let $\xi$ be a complex line bundle over a CW-complex $B$. I want to prove that $\xi$ is trivial if and only if $c_1(\xi)=0$.
My attempt: Suppose $c_1(\xi)=0$. Then the Euler class $e(\xi)=0$. Since $e(\xi)=o_2(\xi)$, there exists a nonvanishing cross section of $\xi|_{sk^2 (B)}$, denoted as $X\in \Gamma(\xi|_{sk^2 (B)})$. $X,JX$ are linearly independent cross sections of $\xi|_{sk^2 (B)}$. Thus $\xi|_{sk^2 (B)}$ is a trivial bundle. How to prove that $\xi$ is trivial?
Let $\xi:E \to B$ be a complex line bundle.
Edit: my first attempt was not true in that generality, although vanishing euler class is equivalent to nowhere vanishing section if the bundle has the same rank as the underlying complex which should be a closed orientable manifold.
To make up for it I will try to give a description to solve your problem correctly.
We know that every complex $n$-vector bundle $\xi$ over $B$ is given by the pullback along a map $B \to G_n(\mathbb C^\infty)=G_n$, where the latter is unique up to homotopy. For line bundles we get $G_1 = \mathbb CP^\infty$. We know that $G_1$ is a $K(\mathbb Z,2)$, so it has a natural identification $[B,G_1] = H^2(B;\mathbb Z)$, hence by the above comment: $\{\text{iso-classes of line bundles}\} = H^2(B;\mathbb Z)$. This gives you your result.
Further notice: you can equip the iso-classes of line bundles with the structure of an abelian group. Looking closer to the identifications above (especially the Eilenberg Maclane space property) you will notice that this is in fact an isomorphism of groups.