Holomorphic line bundles with trivial Chern class are flat Let $X$ be a complex, projective algebraic variety and let's work in the differential-complex setting.
Let $L$ be a non-trivial hermitian holomorphic line bundle and assume that $c_1(L)=0$. Can we always find a connection such that the associated curvature form $\Theta(L)$ is $0$?
In other words, in this setting do we have the following implication?

trivial first Chern class implies flat line bundle

 A: I follow the indication given by @AG learner.
Let $M$ be a connected complex manifold with a base point $p\in M$.
A local system $L$ (of finite dimensional $\mathbb{C}$-vector spaces) of rank $r$ is called unitary if the  monodromy representation  $\rho_L:\pi_1(M,p)\to GL(L_p)$ is unitary. That means the closure (relative to the classical topology) of the image is compact.
As every compact subgroup of $GL_r(\mathbb{C})$ can be conjugated in $U_r(\mathbb{C})$, we may choose a hermitian inner product $h_p$ on the stalk $L_p$ (a $\mathbb{C}$-vector space of dimension $r$) such that $\rho_L$ factors through $U(L_p,h_p)$, For any $q\in M$, choose a path $\gamma$ from $p$ to $q$ and propagate $h_p$ along this curve, ie using the linear isomorphism $\gamma_*:L_p\to L_q$ induced by $\gamma$, we translate $h_p$ to  a hermitian inner product $h_q$ of $L_q$. Then $h_q$ is independent of choice of path since the monodromy is unitary. Thus we get a positive definite hermitian form $h$ on $L$ that is invariant under monodromy action.
By our construction, for any two local sections $s,s'$ of $L$,  the local function $h(s,s')$ on $M$ is locally constant.
Naturally $h$ extends to a hermitian metric on the associated holomorphic vector bundle $L\otimes_{\mathbb{C}}O_M$ and
$Id_L\otimes d$ is a flat hermitian holomorphic connection on it.  Conversely, for a holomorphic hermitian vector bundle $E$ (of rank $r$) with a flat hermitian holomorphic connection $\nabla$,  around every point we can find a local horizontal holomorphic frame $\{e_1,\dots,e_r\}$. For any $1\le i,j\le r$, since this connection is hermitian, we have  $$d[h(e_i,e_j)]=h(\nabla e_i,e_j)+h(e_i,\nabla e_j)=0,$$ so $h(e_i,e_j)$ is locally constant. Thus the subsheaf of $E$ of horizontal sections form a unitary local system.
We summarize the discussions above as:
unitary local system=unitary representation of $\pi_1(M,p)$=holomorphic vector bundle with a flat hermitian holomorphic connection=smooth vector bundle with a flat hermitian smooth connection.
Lemma:  Let $M$ be a connected compact Kahler, manifold, $f:M\to \mathbb{C}$ be a smooth function, If $\bar{\partial} \partial f=0$, then $f$ is  constant.
Proof:  The smooth form $\bar{\partial} f$ is $\bar{\partial}$-exact and $\partial$-closed, so it is $d$-closed. By $\partial\bar{\partial}$-lemma, there is a (complex) smooth form $\beta$ on $M$ with $\bar{\partial} f=\partial \beta$. But $\bar{\partial} f$ is a $(0,1)$-form, so $\bar{\partial} f=0$. Since $\bar{\partial} \partial \bar{f}=0$, we also have $\bar{\partial}\bar{f}=0$. Taking conjugate, we get $\partial f=0$. Then $df=\bar{\partial} f+\partial f=0$. Therefore, $f$ is constant by connectedness of $M$.
Proposition: Let $X$ be a connected compact Kahler manifold, $L\to X$ be a holomorphic line bundle with $c_1(L)=0$, then it admits a  unique (up to scalar)  hermitian metric whose Chern curvature $D$ is a flat  holomorphic connection. Any holomorphic connection on $L$ is flat.
In particular, if $X$ is furthermore simply connected, then the complex torus $Pic^0(X)$ is trivial.
Proof:  First of all, we show that the curvature form (a global holomorphic $2$-form) of different holomorphic connections are the same. In fact, for two holomorphic connection $D, D'$ on $L$,  $D'-D\in H^0(X,\Omega_X^1)$. By Hodge theory, the global  holomorphic 1-form $D'-D$ is $d$-closed. The curvature of $D'$ equals that of $D$.
By  Grothendieck-Cartan-Serre theorem, the complex vector space $H^0(X,\Omega_X^2)$  is finite dimensional. Every element of $Pic^0(X)$ admits a holomorphic connection.  In this way we get a holomorphic map $Pic^0(X)\to H^0(X,\Omega_X^2)$ by taking curvature form. As $Pic^0(X)$ is compact connected, this map is constant. The canonical connection on the trivial line bundle $[O_X]\in Pic^0(X)$ is flat. So this map is constantly zero. In particular, any holomorphic connection on $L$ is flat.
To find a desirable hermitian metric. Recall that   a holomorphic line bundle is always slope stable. By Yau-Uhlenbeck, there is a unitary local system $T$ on $X$ st $L=T\otimes_{\mathbb{C}}O_X$, and $T$ induces such a connection via Riemann-Hilbert. For any such  hermitian metric, its Chern connection is a Hermitian-Yang-Mills connection, so hermitian metric satisfying such property is  unique (up to scalar) by Theorem p.262 loc.cit.
Another proof  avoiding Yau-Uhlenbeck's big result is as follows. Take a hermitian metric $h$ on $L$. Locally its Chern curvature is $\nabla=d+h^{-1}\partial h$. More precisely, let $s$ be a local holomorphic frame for $L$, then $\nabla(s)=h^{-1}\partial h\otimes s$, where $h$ is the local function $h(s,s)$. Its Chern curvature form $R=\bar{\partial}(h^{-1}\partial h)$  is a  $d$-exact $(1,1)$ smooth form by Chern-Weil theory. Divided by $i$, it is a real form. Therefore, by $\partial\bar{\partial}$-lemma, there is a smooth function $f:X\to \mathbb{R}$ with \begin{equation}\label{eq:deedee}
 R+\bar{\partial} \partial f=0.
 \end{equation} Define a new hermitian metric by $h'(s,s)=e^fh(s,s)$. Then the new Chern curvature is $\nabla'=\nabla+\partial f$, or rather, $\nabla'(s)=\nabla(s)+(\partial f)\otimes s$. Applying $\bar{\partial}^L$, we get $$\bar{\partial}^L(\nabla'(s))=R\otimes s+(\bar{\partial} \partial f)\otimes s=0,$$ ie $\nabla'(s)\in \Omega_X^1\otimes L$. That means $\nabla'$ is a holomorphic connection and the new Chern curvature $R'=R+\bar{\partial} \partial f=0$, i.e. the new Chern curvature is flat. So far we have established the existence of such metric.
Conversely,  any such metric $h'$ is in the above form where $f$ is a solution to $R+\bar{\partial}\partial f=0$. Former result shows that such a solution $f$ is unique up to addition by constant. So such metric is unique up to scalar.
Remark: Last result is false without the Kahler condition. There is a simply connected compact complex manifold   $X$, $L\to X$ a nontrivial holomorphic line bundle with $c_1(L)=0$ so it admits a holomorphic connection. But it cannot be flat, else $L$ comes from a local system, but $X$ simply connected then $L$ would be trivial holomorphic line bundle.  $Pic^0(X)$ not trivial.
A: Checking the details of the following amounts to actually doing all the math, but it's worth zooming out and thinking about the exponential exact sequence just so you can guess when something like this will be true.
The stipulation on the Chern class says that your line bundle is in the kernel of the map
$$
H^1(X, \mathcal{O}^\times) \to H^2(X, \mathbb{Z})
$$
and so it is in the image of the exponential map $H^1(X, \mathcal{O}) \to H^1(X, \mathcal{O}^\times)$.
On the other hand, a line bundle admits a flat connection if and only if it is in the image of the map
$$
H^1(X, \mathbb{C}^\times) \to H^1(X, \mathcal{O}^\times),
$$
which is the kernel of the map on $H^1$ induced by $\text{dlog}: \mathcal{O}^\times \to \Omega_X$.
So we want to know that the image of the map induced on cohomology by $\exp$
is contained in the kernel of the map induced by $\text{dlog}$. But $\text{dlog} \circ \exp = d$, so we are really asking if $d: H^1(X, \mathcal{O}) \to H^1(X, \Omega)$ is the zero map (n.b. this is a map of sheaves of abelian groups, not $\mathcal{O}$-modules). It is! Miracle, its kernel is the image of the map $H^1(X, \mathbb{C})\to H^1(X, \mathcal{O})$ which, by Hodge theory, is just a projection onto a summand.
