\newcommand
is the command you look for (see sashkello answer)
There are some things you should look for:
\documentclass{scrartcl}
\newcommand{\by}{\textbf{y}}
\begin{document}
Now we write a \by and a x.
\end{document}

The y is direct connected to the and
.
You may add a space in \newcommand
to add a space before the and
:
\documentclass{scrartcl}
\newcommand{\by}{\textbf{y} } %<- space before the closing }
\begin{document}
Now we write a \by and a x.
Now we write a \by. The next sentence.
\end{document}

The next problem: There is an additional space when you start a new sentence.
For this problem you may use \xspace
:
\documentclass{scrartcl}
\usepackage{xspace}
\newcommand{\by}{\textbf{y}\xspace}
\begin{document}
Now we write a \by and a x.
Now we write a \by. The next sentence.
\end{document}
The result:

\bf
has been deprecated for two decades now. – Martin Schröder Aug 9 '13 at 20:55