How should I install a thermostat for a baseboard heater?
In most thermostat installation guides, it's recommended to install the thermostat on an interior wall across from the heater.  If you trace the existing wires, it's possible the thermostat will end up above the heater. This is not ideal, and could lead to a poorly heated room.  You might get lucky, but in most cases there are a couple more appropriate options.
Use the heater as junction point
There should be an area of the heater used to make electrical connections. If this area is large enough, you can use it to extend the supply conductors out to the thermostat and back.

To do this...

Turn off the power to the circuit at the breaker/fuse box, and insure it's off using a non-contact voltage tester.
Run 2 new cables (4 wires, 6 if the circuit has grounding conductors) from the heater to the thermostat location.
Disconnect the supply conductors from the heater.
Using twist-on wire connectors (or any approved means), connect the supply conductors to one set of conductors leading to the thermostat.
Connect the other set of conductors from the thermostat to the heater.
Make the connections at the thermostat.
Turn the power back on, and enjoy.

Pull all new cable
The other option is to pull all new cable.

To do this...

Turn off the power to the circuit at the breaker/fuse box, and insure it's off using a non-contact voltage tester.
Pull a cable from the breaker/fuse panel to the thermostat location.
Pull a cable from the thermostat location to the heater.
Disconnect the existing cable from the heater, and remove the cable.
Connect the new cable to the heater.
Make the connections at the thermostat.
Connect the new cable in the breaker/fuse panel to the breaker/fuse used previously.
Turn the power back on, and enjoy.