Probably this will miss more complex scenarios, but from here:
%%
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\DeclareUnicodeCharacter{B5}{\ifmmode\mu\else\textmu\fi}
%
% use http://shapecatcher.com/ to find the char
% or https://w3c.github.io/xml-entities/unicode-names.html
\begin{document}
This is a textmode µ and this a math mode one: $µ_µ$.
\end{document}

If you do not want to define everything, you need to switch to a native unicode TeX engine, like for example xelatex. If you compilte with xelatex the following code:
%%
\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
%
% use http://shapecatcher.com/ to find the char
% or https://w3c.github.io/xml-entities/unicode-names.html
\begin{document}
Is the character ẁ used in some language?
This is a textmode µ and this a math mode one: $_$.
(But be careful, math mu is a different unicode codepoint,
\texttt{1D707}.)
\end{document}
to obtain:

Where I am using the unicode-math package; I found the mathmode µ codepoint at shapcatcher.