This should work. You need to use that because pandoc latex template already use xcolor.
In this minimal reprex it does.
---
output:
pdf_document
header-includes:
- \PassOptionsToPackage{x11names}{xcolor}
---
The next text will have a color change **\textcolor{blue}{LIKE THIS}**, or like **\textcolor{purple}{THIS}** and finally as **\textcolor{red}{THIS ONE}** ...something else.