Please use units that can counter the enemy unit types. For example, if you place the pikemen in front, you should prioritize attacking cavalry first. Monks are effective against enemy pikemen, and so on.
You can check the unit counter chart in the unit upgrade menu. The chart is located near the info ‘unit type’ on the left side of the big unit display. There, you will see a circle and just click on it to open the chart.