As @Zxcvasdf already explained, you can use \company{} instead of \company. If you don't want to type {} all the time (maybe because they are hard to type with your keyboard layout or you need \company very often) you can also use the xspace package. It provides the command \xspace which produces a space whenever it is needed.
\documentclass{article}
\usepackage{xspace}
\def\company{ACME\xspace}
\begin{document}
The company \company is great! % <- space is inserted
I like the company \company. % <- no space is inserted
\end{document}

Let me briefly comment on why you should not use ~ here for inserting a space: ~ produces a non-breaking space, i.e. there cannot be a line break between these two words. Sometimes this is good style, e.g. in See Figure~\ref{fig} because you do not want to have Figure and the referenced number in different lines, but here there is no reason why you should not allow a line break.
\company{}instead of\company. It will put spaces where there is no punctuation. – Zxcvasdf Mar 03 '23 at 08:02~if you want a no-break space,{}or\otherwise. – David Carlisle Mar 03 '23 at 08:50