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.