The parametric equation of a line looks like $$\begin{matrix}\vec r(t) = \vec r_0 + t\vec v, & t\in \Bbb R\end{matrix}$$ where $\vec r_0$ is a vector pointing from the origin to a point $P(x_1, x_2, \dots, x_n)$ on the the line and $\vec v$ is a vector parallel to the line. Then $t$ is just your variable.
Notice that this looks very similar to the scalar equation of a line $y=mx+b$.
In your equation you're given a line segment defined by its two endpoints. Let's say those endpoints are $A(x_1,y_1,z_1)$ and $B(x_2,y_2,z_2)$. Then first let's figure out what its midpoint is. We need this because, as a point on the line we're trying to parametrize, it'll give us a point we can use to define $\vec r_0$. The midpoint of the points $A(x_1,y_1,z_1)$ and $B(x_2, y_2, z_2)$ is the point $$M\left(\frac{x_1 + x_2}{2},\frac{y_1 + y_2}{2},\frac{z_1 + z_2}{2}\right)$$ So our vector $\vec r_0$ is just $\vec{OM}$.
The next bit of info we need from that line segment is to know a vector parallel to it. The two easiest vectors will be $\vec{AB} = \vec{OB} - \vec{OA}$ and $\vec{BA} = \vec{OA} - \vec{OB}$. Compute one of those vectors.
Why do we need to know a vector parallel to the line segment when we want a line perpendicular to the line segment? Because I said so :P. Also because once we find that vector, say it's $\vec{AB} = a_1\hat e_1 + a_2\hat e_2 + a_3\hat e_3$ -- where $\{\hat e_1, \hat e_2, \hat e_3\}$ is an orthonormal basis for $\Bbb R^3$, we can use the definition of orthgonality to figure out a vector perpendicular to it.
The definition of orthogonality (perpendicularity) is $\vec a \text{ is orthogonal to } \vec b \iff \vec a \cdot \vec b = 0$. Therefore, we can find $\vec v$ by simply using this formula with the vector $\vec{AB}$ that we already found. So find any nonzero solution to the equation $\vec v \cdot \vec{AB} = 0$ and you'll have your $\vec v$.
Then, having $\vec r_0$ and $\vec v$, just write down your parametric equation $$\begin{matrix}\vec r(t) = \vec r_0 + t\vec v, & t\in \Bbb R\end{matrix}$$
Let's look at an example: say we're given the line segment whose endpoints are $A(1,1,1)$ and $B(2,0,2)$.
Then using the above we see that $$\operatorname{Midpoint}(A,B) = M\left(\frac{1+2}{2},\frac{1+0}{2},\frac{1+2}{2}\right) = M\left(\frac 32, \frac 12, \frac 32\right) \\ \implies \vec r_0 = \vec{OM} = \frac 32e_1 + \frac 12e_2 + \frac 32e_3 \\ \vec{AB} = \vec{OB} - \vec{OA} = (2\hat e_1 +0\hat e_2 + 2\hat e_3) - (1\hat e_1 + 1\hat e_2 + 1\hat e_3) = \hat e_1 -\hat e_2+\hat e_3 \\ \implies \vec v \cdot \vec{AB} = (v_1\hat e_1 + v_2\hat e_2 + v_3\hat e_3) \cdot (\hat e_1 - \hat e_2 + \hat e_3) = 0 \\ \implies v_1 -v_2 + v_3 = 0$$ We only need $1$ solution (out of an infinite number of solutions) to the above equation, so at this point, we'll let $v_1$ and $v_2$ be easy numbers (that are not both $0$), like $v_1 = 1$ and $v_2=0$, and just solve for $v_3$. Solving, we can clearly see that $v_3=-1$ when $v_1 =1$ and $v_2=0$. Therefore $$\vec v = 1\hat e_1 + 0\hat e_2 + (-1)\hat e_3 = \hat e_1 -\hat e_3$$ Putting all of this together, the equation of one of the lines perpendicular to the line segment $\overline{AB}$, passing through its midpoint is $$\require{enclose}\enclose{box}{\begin{matrix}\vec r(t) = \left(\frac 32e_1 + \frac 12e_2 + \frac 32e_3\right) + t(\hat e_1 -\hat e_3), & t\in \Bbb R\end{matrix}}$$