I just got quite interested in history recently, and I have been watching history documentaries. An observation I have had about ancient, classical and medieval warfare is that the archers don't really do much. Most of the hard work in a battle is mostly done by infantry and calvary, while the archers only play a minor role. I know there a some exceptions like the Battle of Agincourt, but it seems archers are mostly relegated to a side role.
If archers were not that useful, why would an army even utilise them?
The trap you fell into here is the common assumption that pitched battle is the whole of war. Yes, when large premodern armies met for an engagement in open ground, heavy infantry and cavalry tended to have the advantage; unless armies specialised in effective archery, there wouldn't be much that archers could do before the close combat specialists met in hand-to-hand combat, shutting out the light infantry. But these pitched battles were only a very small fraction of premodern warfare. In pretty much all of the rest of it, archers reliably proved themselves devastatingly useful.
When your city is under attack, you want archers. When you're attacking a city, you want archers. When you're fighting on ships, you want archers. When your army is marching through enemy territory, you want archers. When the enemy is harrassing your column, you want archers. When you're ambushing the enemy, you want archers. When the enemy is running away, you want archers. When the enemy has archers, you want archers. These are still only a handful of scenarios - each of them likely to be more common than pitched battle. In some of them, other troop types can fill the same role; slingers can also bombard the enemy, while cavalry can also drive off enemy skirmishers. But there are many situations in which a unit of competent archers is the most effective weapon.
Here's Thucydides describing what happened when a group of 300 Athenian hoplites with an archer escort fell into an ambush of Aitolian javelin throwers in 427 BC:
Still, as long as their archers had arrows left and were able to use them, they held out, the light-armed Aitolians retreating before the arrows; but after the captain of the archers had been killed and his men scattered, the soldiers, wearied out with the constant repetition of the same exertions and hard pressed by the Aitolians with their javelins, at last turned and fled.
-- Thuc. 3.98.1
Here's Xenophon, describing the scene in 388 BC when a Spartan army pressed so close to the city of Argos that the Argives dared not open their gates even for the cavalry of their allies:
Once, when most of the Argives were away in Lakonia, [the Spartan king Agesipolis] approached so near the gates that the Argives who were at the gates shut out the horsemen of the Boiotians who wanted to enter, through fear that the Spartans would rush in at the gates along with them; so that the horsemen were compelled to cling like bats to the walls beneath the battlements. And if it had not chanced that the Cretans were off on a plundering expedition to Nauplia at that time, many men and horses would have been shot down by their arrows.
-- Xen. Hell. 4.7.6
There are many similar examples in Greek history where the archers are singled out for special praise. The same can probably be said about archers in other periods and regions of the world. You'll notice that these situations in which archers took centre stage were not pitched battles. It was only in situations like these that they were able to strike terror into heavy infantry and cavalry. But such situations were common, and good commanders anticipated them, and so archers were properly valued for their service to the safety of the whole army. This was why the Athenian Empire prided itself in its standing corps of 1600 archers, and why many Greek states spent lavish sums on Cretan mercenary archers.