Style of subsection part

I am new to latex; hence, this can be trivial question. However, I could not handle it.

I want to make my subsection title bold and italic. I tried some methods, but I could not accomplish it.

\documentclass[preprint,authoryear,12pt]{elsarticle}
\usepackage[utf8]{inputenc}

\begin{document}

\maketitle

\section{Introduction}
\subsection{My Life}
\end{document}


The style of subsection part My Life is italic and not bold. I want to make it both bold and italic. By the way, I have to use the document class in sample code above. It is necessity provided by article owners of my university.

• Have a look here: tex.stackexchange.com/questions/165930/… – Sango Sep 17 '19 at 8:17
• Could you please clarify on "by article owners of my university"? If you wish to use elsarticle because you want to publish a paper with them, it might be better to not change their style. – leandriis Sep 17 '19 at 8:19

And here is my comment as an answer, use package titlesec:

\documentclass[preprint,authoryear,12pt]{elsarticle}
\usepackage[utf8]{inputenc}
\usepackage{titlesec}

\titleformat{\subsection}
{\normalfont\fontfamily{phv}\fontsize{12}{17}\bfseries\itshape}{\thesubsection}{1em}{}

\begin{document}

\maketitle

\section{Introduction}
\subsection{My Life}
\end{document}