The rules are as follows:
- Use complete, single paths, or, using your own words from the comments below: "draw it in one shot". That is, do not use more than one
\draw, \path or so command. Also make sure that there are no gaps.
- Add
-- cycle to close a closed path.
- Optional: use an appropriate line join.
Applied to your picture, this yields
\documentclass[tikz, border=3mm]{standalone}
\begin{document}
\tikzset{every picture/.style=thick}
\begin{tikzpicture}[scale=0.2]
\begin{scope}
\draw (12,4) -- (12,3) arc (-90:180:1) -- cycle;
\draw (11,-1) -- (13,-1) -- (13,1) -- (11,1) -- (13,0) -- cycle;
\end{scope}
\begin{scope}[xshift=3.5cm,line join=round]
\draw (12,4) -- (12,3) arc (-90:180:1) -- cycle;
\draw (11,-1) -- (13,-1) -- (13,1) -- (11,1) -- (13,0) -- cycle;
\end{scope}
\begin{scope}[xshift=7cm,line join=bevel]
\draw (12,4) -- (12,3) arc (-90:180:1) -- cycle;
\draw (11,-1) -- (13,-1) -- (13,1) -- (11,1) -- (13,0) -- cycle;
\end{scope}
\begin{scope}[xshift=10.5cm,miter limit=1]
\draw (12,4) -- (12,3) arc (-90:180:1) -- cycle;
\draw (11,-1) -- (13,-1) -- (13,1) -- (11,1) -- (13,0) -- cycle;
\end{scope}
\end{tikzpicture}
\end{document}

This surveys a few different line join options, see p. 172 of pgfmanual v3.1.4 for more information.
Of course, if you patch together different paths to have nice line joins, it may happen that you have to, or it is at least advantageous to, revert the direction of some segments. For instance, when patching together the three segments of the addendum of your question, I reverted one arc to get
\documentclass[tikz, border=3mm]{standalone}
\begin{document}
\tikzset{every picture/.style=thick}
\begin{tikzpicture}[scale=0.25]
\draw (5,7) -- (7,5) -- (5,5) -- (7,7)
arc (90:180:1) arc (0:90:1) -- cycle;
\end{tikzpicture}
\end{document}

The path can be shortened to
\draw (7,5) -- (5,5) -- (7,7) arc (90:180:1) arc (0:90:1) -- cycle;
line join=round, or replace it byline join=bevelor dial somemiter limit, see p. 172 of pgfmanual v3.1.4. – Dec 10 '19 at 01:03