I don't know how wrong I am, but depictions of battles around those centuries usually consist of lines of infantry shooting their muskets in volleys at each other and then charging with bayonets, all while being under heavy artillery fire. How did that work? Did you just stand there, shoot your muskeet and then prepare to take a bullet/cannonball? Or were there fortifications and trenches like in early 20th century?
Battle in this period was vastly more complicated than film might make it appear. While advancing in open fields and firing ordered volleys from close range was a thing that happened, it was almost always happening in conjunction with some deeper or more subtle purpose. A face-to-face engagement might try a mask a dash at the flanks by another force, or might be a fixing action, a way to keep the enemy busy while other portions of the army work somewhere else.
Trenches, fortifications, siege warfare, raiding, skirmishing, ambush, and combined-arms tactics and strategies were absolutely omnipresent in 18th century warfare.
I've written quite a lot on this topic. I'm happy to answer follow ups, but you may be interested in reading some of my older answers:
On the role of veteran soldiers
On the hardships of soldiering
Its a more complicated subject than it appears on the surface. The important to thing is to discuss why linear tactics (line formation) was used to begin with. It was a way to effectively add more firepower to the single shot musket by having more men fire at once. In addition, the longer the line, the harder it was to be flanked. Sometimes emplacement like trenches would be used but really only in a prolonged siege which remained rather rare during the period. Battles were more than likely to be encounter battles between two forces who run into each other in the same area.
Many soldiers of the period are also criminals or people who simply had no other way to make money in life. Military service was a common way to escape jail time or in the case of expatriates, a way to seek asylum away from your home nation by serving the military of another. They usually werent super disciplined soldiers, and most were lucky to even fire their guns 5 times a year in training. Artillery for most of the period remained mostly counter battery fire between the cannons of each side. Napoleon is renowned for changing the use of cannons and shifting them to focus more on infantry.
Depictions in media today usually show stoic soldiers just aimlessly fire at one another. In truth, reality is very different. A great book that sheds light on the subject is Tactics and the Experience of battle in the Age of Napoleon by Rory Muir. He seeks to show what combat was truly like for different branches and goes into topics such as faking injuries to avoid combat, indiscipline, ect. It humanizes the battles. So while on the surface, yes it was expected of the soldiers to sit their and trade fire, reality is a lot less clear and shows a wide range of reactions to battle in this period.