I struggle to understand why firearms would be developed in a society with as much readily available offensive magic as the D&D world.
Also, in the real world, the musket brought an end to the armored knight, a staple of fantasy gaming. It changed combat significantly, to something that I would say is much more "modern" that what I want in a fantasy game.
I prefer to keep guns away from fantasy, in general.
Actually, professional armies brought the era of the armoured noble knight to an end, not firearms. After all, suites of full plate armour rose along side the firearm. They didn't come onto the field for centuries before, and then suddenly disappear overnight when guns hit the fields. Design and development of armour has as much to do with fashion as it did with warfare. Economics and the redevelopment of cheap sheets of steel also had a big hand.
The pike and disciplined formations who could hold rank against a charge, and still be flexible enough to move as a unit on the field, limited the ability of a knight to crush infantry. Add in the ever increasing armour that was affordable to a greater part of an army, and then suddenly you have a bristling hedge hog that horses won't charge against, and can more easily survive volley fire from archers.
We eventually find a relatively inexpensive counter to heavy cavalry of the late medieval/early renaissance era with what became common infantry. Horses are expensive, and eventually it became cheaper to keep large trained infantry units than enough cavalry to truly equal them on the field.
Firearms did not drive the knight from they battlefield, they killed off the bowman instead. Bowmen were expensive and hard to train. Good bows were hard to build, required a large investment in time and money before they could be fielded, and their ammunition was bulky and required a lot of skilled labour to produce. The firearm on the other hand, could be put in the hands of anyone, given a days training, and be marginally effective on a battle field. The total time required to go from raw materials to finished product was far lower for firearms, start to finish could be days for an ordered gun, where as it could be months for a bow. (Wood had to be properly seasoned, iron/bronze didn't.) Ammunition could be produced by very limited skilled persons with only very basic training when properly supervised, and vast stores could easily be stockpiled and moved in a very compact volume as compared to arrows.
The truth is, basic firearms are seen in Europe from the 1300's onward, and possibly earlier, and they go right along side a vast majority of things people take for granted in 'fantasy'. I'm sure you can understand how lines like "It doesn't fit the period!" can really annoy people who study and enjoy history.
Don't want firearms? Then say they are nearly unheard of in the world, a fool's toy. Those who are smart enough to understand and safely use firearms are too 'upper class' to put up with staining their fine clothes with such foul smoke, or have magic that makes a cannon look like a fire cracker, and that lesser people who could actually benefit from them think guns are devil spawn and fear them too much.
Or claim they were viewed as dishonourable, and no one caught with a gun or gun powder would be trusted, or even strung up in the town square.
Therefore guns stayed as an oddity that never took off, like the electric car.
Don't claim they "don't fit" exactly where they did in history.
Most combats started with a volley of bullets followed by a quick charge for melee. One player's character ended up with several matchlock pistols thanks to aggressive looting. He kept smouldering wicks tied in his beard so that he could more quickly bring his pistols to bear.
Realistic? Hardly. But it was a hoot.
Actually, that sounds a lot like real combat with primitive firearms, smoldering matches included. Fire the loaded weapons, then charge. A lot of early firearms were even made as basically maces: Shoot it, grab the end of the barrel, and bash people's heads in with the pommel of the pistol's grip.
Smoldering matches in the beard does put you in a sticky spot when it comes to a botch however.