One of the first ways to farm without any losses is to attack NPCs lvl 1-5 with ballistas and transports, but it isn't as easy as build and attack them.
First you have to have the correct Archery/Horseback riding combo. Yes a wrong combo and you will lose either some or all of your troops.
Archery lvl 8 and Horseback riding lvl 5 or 6
Archery lvl 9 and Horseback riding lvl 8 or 9
Archery lvl 10 and any Horseback riding lvl
Second you will need to build ballistas and transports
Lvl 1 NPC = 20 Ballistas
Lvl 2 NPC = 50 Ballistas
Lvl 3 NPC = 170 Ballistas
Lvl 4 NPC = 250 Ballistas
Lvl 5 NPC = 550 BallistasThese numbers are safe if you have a high attack hero you can lower these numbers. Transports vary depeding on your Logistics lvl but you can send about 20-50 more than ballistas should work
Third scout and make sure no one has already farmed the NPC. NPCs regenerate full resources every 8 hours.