Apologies if the question is a bit broad in scope, but in this video from scholagladiatora, Matt Easton claims that "a sword, in most periods of history... is a secondary weapon... [or even] a tertiary weapon" and that "generally speaking... people who carried swords had as their first weapon either a pole weapon... or a missile weapon."
How accurate is this claim?
Well the use of swords as weapons covers thousands of years and I have nowhere near the knowledge base to answer this question one way or another. I'll nonetheless to give you snapshots on this subject at a couple different periods.
During the Roman period for example, we know from Vegetius' De Re Militari as well as other contemporary accounts of Roman tactics that the ordinary legionary carried one or more Pila, which were cunningly engineered throwing spears or javelins that bent on impact, thereby making them useless to enemies once they had been thrown. After throwing their javelins (and some enemies would be defeated or sufficiently demoralized by the volley of hundreds of spears) the legionaries would close with the short sword or gladius to defeat the enemy in close combat. This was all of course combined with numerous other tactics and weaponries (slingers from the Balearics were common). It was the combination of tactics and their organization that helped the Romans succeed in battle. In this case we can see that technically the gladius or short sword was a secondary weapon (in terms of the phase of battle it was used in) but it is important to note that legionaries were expected to be just as adept with a sword as with pila. If anything the correct use if a short sword in conjunction with hundreds of your comrades required more discipline and training than that of pila, but that is up for debate.
Moving into medieval times, or at least after the roman legions were consigned to history, the role of the sword changes somewhat. The Germanic peoples who had invaded the Roman Empire and settled within it's boundaries had adopted many of the Roman's tactics. Indeed many had fought at some time or another as Roman Foederati or mercenaries, and had gleaned much of the organization and tactics from this exchange. The use of a short sword by Germanic warriors is well documented, with the Saxons perhaps taking their very name from their use of the scramasaxe, which was a type of short sword. However in addition to the short sword (which was only very useful in close, cramped engagements, and generally useless on horseback) many leading warriors began to utilize a longer broadsword model. The development of this type of weapon traces it's origins back to the roman spatha, which was commonly used by cavalry troops because of it's longer reach. This morphed over time into the more widely known Viking sword, which became an important weapon after the 8th century. While arguably not as effective as other weapons (axes, spears and short swords were still in use), the long sword nonetheless became an important status symbol among warriors at this time. Important mythological stories like the Poetic Edda, Beowulf, and various Norse folktales show the mystical importance put upon certain swords. In addition, swords used a large amount of metal (at least in comparison to axes or spears) and along with mail armor (also an important status symbol) was very expensive to obtain and maintain.
With the advent of more heavily armed cavalry units (think early knights) the long sword continued to gain importance. It remained an expensive weapon, and because of it's reach (important for men fighting in horseback) became a primary weapon of most knights/men at arms. Of course the lance was the first weapon used in any battle, but most lances were only useful for one or two charges and in the absence of regular re supply most troops fell back on their swords.
The issue that continued to define weapon development was the growth of armor usage. As early as the Viking period, a man with mail armor was almost impervious to anything but a clean sword thrust. Axes, spears and short swords were arguably more effective against a mailed man, and this goes some way towards explaining why poorer warriors would prefer these weapons to a more expensive sword.
As armor technology progressed during the medieval period, long swords became less and less effective. With the advent of heavy plate armor, swords became more useful as a tool to batter your enemy down as opposed to actively stabbing or slicing him. At this point many knights and men at arms preferred more effective weaponry, such as pole arms (which covers a broad array of weaponry), axes, maces and lances. However the sword remained an important status symbol, and Henry V is said to have wielded a sword at Agincourt.
All this was very long winded, but it should give you some idea as to the nature of sword use, at least from the Roman Empire to the Hundred years war. For much of it's time the sword was a tool of the wealthy or important, and was a primary tool of war. As armor progressed it became less useful when compared to other weapons but continued to be seen as prestigious and remained in use into modern times amongst various militaries.
This is absolutely true for basically all of premodern Japanese military history.
Samurai are known today for their katana but this is a major misconception since the main weapon of mass warfare from the Gempei War to the Sengoku Period was always the spear.
Even as a status symbol, samurai were prized for their skill as mounted horsemen, meaning the bow was the true sign of a samurai.
And of course, during the 16th century Sengoku Period, samurai had plenty of firearms.
The sword was generally only used if a samurai could no longer fight with spear or bow or gun. So indeed, for much of Japan's military history, the sword was a secondary/tertiary weapon on the battlefield. In fact, swords were often used to take the heads of enemy warriors after they were long dead, to bring back to their lords to obtain promotions.
Swords began to be romanticized and mystified during the Edo Period, after the Sengoku Period ended and much organized warfare was gone, to be replaced by a period of relative peace for several centuries. During this time, many regulations on owning weapons, manufacture of weapons, and arming one's men with weapons were put in place by the shogunate.
Due to this, many samurai were only left with their swords, most noticeably firearms being monopolized and reserved for the most trusted and loyal servants of the shogunate.