The quickest answer: it depends on the context — here are common ways to create a horizontal line.
Markdown
Use a horizontal rule on its own line:
---
(or *** or ___) — must be on a line by itself with optional surrounding blank lines.
HTML
Use the hr element:
<hr>
<!-- or -->
<hr />
LaTeX
For a full-width rule in normal text:
$$\noindent\rule{\linewidth}{0.4pt}$$
Inside tabular environments use \hline:
$$\begin{tabular}{l l}
a & b \\ \hline
c & d
\end{tabular}$$
CSS (custom styling)
Use a styled border on an element or style an <hr>:
<hr style="border:0;height:1px;background:#000;">
<!-- or -->
<div style="border-top:1px solid #000;margin:16px 0;"></div>
Math / Graphing
A horizontal line in coordinate geometry is an equation of the form $y=c$ (a constant).
Which context do you mean (Markdown, HTML, LaTeX, CSS, Word/Docs, math, or something else)? I can give a tailored example.