How to Craft a Flintlock Musket from Scratch
Gather the base materials
You need Iron Bits and Lead Bits (produced with the Hacksaw or Mortar and Pestle recipes on the Gunsmith's Bench), plus Brass Ingot and Brass Nugget for the lockwork. Wood comes from Large Wooden Stock and Large Wooden Handle. Make Low-grade Black Powder first, then upgrade it toward Medium-grade Black Powder and High-grade Black Powder as your barrels improve.
Build the lock, barrel, and stock
On the Gunsmith's Bench, craft a Flintlock Mechanism from Iron Bits, Brass Nugget, and a Diamond Trigger Assembly or Iron Trigger Assembly depending on the tier you want. Combine the mechanism with a Large Iron Barrel (or Large Brass Barrel) and a Large Wooden Stock in the bench's shaped recipes. The Flintlock Musket is the assembled result of these parts.
Load and fire
With the musket in hand, use the muzzleloader reload recipe: hold a Large Lead Musket Ball or Large Lead Musket Ball Paper Cartridge, add a Large Powder Charge of High-grade Black Powder, and a Fuse or Match Cord if the lock requires ignition. The firearm_muzzleloader_reload_shapeless recipe handles this in your inventory. Right-click to fire. Repair worn muskets with a Firearm Repair Kit or Flintlock Repair Parts.