Depends on the environment: there are different controls for Web and WinForms for example.
For the Winforms TreeView, it's pretty simple:
Set Icons for TreeView Control - Windows Forms | Microsoft Docs[
^]
For Wed TreeViews, it's also simple - just set the
ImageUrl
property:
<asp:TreeNode ImageUrl="image.jpg"></asp:TreeNode>