Thanks Haly. In situations where I'm in a lane against range I'm not great with dealing with harassment so my last hit timings suffer.
An advanced technique is to attack command the enemy heroes, drawing creep aggro toward you. If you do this right you can pull the enemy creeps in front of your creep wave.
The hardest part of this is actually to be able to to this consistently and getting the enemy creeps to attack your ranged creeps so you don't start pushing the lane.
Practicing against bots is probably a good way to learn this (or just playing a lot obviously)