Here's a picture of gearbox, note that each "gear" is actually pairs of two gears, one on input-shaft and one on output-shaft.
They are selected by shifter-forks that slides pairs of gears along both shafts. Gears engage of different sizes for different gear-ratios. Now, in order for these gear-pairs to disengage, slide and different pairs re-engage, it's obvious that two shafts should be spinning at same rate right?
Now, this is where the clutch comes in (right).
Engine drives the outside of the clutch-basket and input-shaft is connected to the inside of clutch-basket. With clutch engaged, input-shaft spins in-sync with crankshaft at ratio of primary-drive gearing. When stopped, output-shaft is stationary, but engine is spinning, thus input-shaft is also spinning. Trying to change gears will be difficult because one gear on output-shaft is not moving, while matching gear on input-shaft is spinning with engine.
Squeezing clutch lever then separates the clutch-halves and allows engine to continue spinning outside clutch-basket while inside stops and input-shaft stops. With both input & output-shaft stopped, you can then slide next gear-pairs together. IF the clutch doesn't disengage fully, then trying to shift a spinning-gear into a stationary-gear will be difficult, you'll end up with gear-grinding and banging.
IF it's making this kind of noise when you let out clutch-lever, then this can be caused by broken gears, mis-aligned half-engaged gears, and/or clutch-basket or clutch-disc fingers broken. Try more positive and forceful gear-shifter movements so you can feel it clank at end of travel. Like slamming ammo clip into gun. Half-assing it will cause problems, hit it until it's at end of travel every time.