To provide an string for which an HTML parser will recognise the need to render the text in Italics, wrap the text in <i> and </i>.  For example:  "This is plain text, but <i>this is in Italics</i>.".
However, most HTML processors will assume that you want your text to appear as-is and will escape their input by default.  This means that the special meanings of certain characters - including < and > will be "turned off".  You need to tell the processor not to do this.  How you do that will depend on context.  I can't tell you that because you haven't given me context.
Are you for example, writing to a raw HTML file?  (You need do nothing.)  Are you writing to a Markdown file?  If so, how?  In plain text or in a rendered chunk?  Are you writing a caption to a graphic?  (Waldi has suggested a solution.)  Etc, etc....