From Android Wiki
Guide can be found at xda-developers.
There is also an alternative approach. I have successfully got root through latest Linux kernel local privilege escalation bug. I have used exploit from FlashRec (you can use already compiled asroot program from FlashRec apk to run busybox binary with root privileges). This is really a clean way to get root, you do not change anything in the system (but of course you can later on). There is a word that this was already patched but at least my Hero (bought from T-Mobile Austria) does not have this patched.
A guide to this alternative approach can be found at theunlockr.com.
Telus HTC Hero
The method above doesn't work out of the box if you have a stock HTC Hero. Before attempting to root an HTC Hero from Telus, you have to downgrade your HTC ROM using this list of untouched HTC Hero Roms, using a GoldCard in the process (See this post for a brief procedure found out by the (seemingly) first person who rooted an Telus HTC Hero).
Although this isn't a complete list, the ROM version 2.73.405.5 (at most) is known to be rootable. Other newer versions was not rootable using the method mentioned in the above paragraph. (Please add other ROM versions known to be rootable if you do know)
Source(s): Android solutions