Turrets can be placed on broken up soil at your farm.
They will automatically fire at the enemy.
If you unroot a turret, you can collect it and return it to the inventory so they can be redeployed again at another location.