Define a metric based on a topology Is their a systematic way, based on a topology meterizable $(X, t)$ to define or compute some metric $d$ on $X$ such that the open balls in $(X, d)$ is a metric of $(X, t)$?

There is no canonical metric associated to a metrisable topological space because, if $d\colon X\times X\rightarrow\mathbb{R}$ is a metric, then so is $d_a$ defined by $d_a(x,y)=a.d(x,y)$ for some $a> 0$. If $a\neq 1$ then $d_a\neq d$ for all $X$ with more than one element.
In fact, it gets worse. We can't even define a canonical metric on $X$ 'up to a choice of constant multiple' because if $d$ is a metric, then so is $d^*$ defined by $d^*(x,y)=\min\{1,d(x,y)\}$ and so is $d'$ defined by $d'(x,y)=\dfrac{d(x,y)}{d(x,y)+1}$. Which are both bounded metrics which induce the same topology as $d$, and so if $d$ is not bounded, both $d'$ and $d^*$ are equivalent metrics which are not equal to $d$ or even equal 'up to a choice of constant multiple'.
