1) Make the texture a .tga (I recommend .tga, but you can use whatever format you want)
2) Get VTFEdit
from here
3) Import the texture in VTFEdit
4) Save it as a .vtf in Steam/Steamapps/common/Team Fortress 2/tf/materials
5) While still in VTFEdit with your texture open, click on Tools > Create VMT File and make sure it's also saved in the materials folder
The texture should work in hammer now.
However, if you still have problems, open up the .vmt file and check if $basetexture has the correct file path. (But if you followed what I said and put the .vtf in the materials folder, you only need to enter the name of the .vtf at $basetexture)