The thing is when I attack a harvesters with the a hotkey, My Zerglings will always attack offensive units (which are almost always behind). Of course I can manualy attack probes/SCVs/drones one by one but I'm sure there's an easier way to do this. How can I effectively attack harvesters?
The best way to achieve attacking harvesters in your described method would be to run all your zerglings into the mining path of the harvesters and hitting H (hold position). This way the zerglings will avoid running after the units shooting them and only attack the units that are within their immediate attack range, which will be the harvesters as they path back and forth.
This is the most effective, least micro-intensive way of doing it. Otherwise you will either go with A-Move (which is not what you want) or you will have to micro target each harvester individually.