Stainless steel needs oxygen to stop it 'oxidising/rusting'.
Blued gun metal/steel needs a coating of something to stop it 'oxidising/rusting'.
Something can be oil or paint or any other impervious medium.
Carbon/soot builds up in the chamber, throat (more so) and barrel, the boltface and bolt can also attract grime.
The external areas need a wipe down with a clean lightly oiled rag when you can see they are dirty.
The throat and bore can be cleaned with a brush or cloth patch on an appropriately sized stick (called a cleaning rod).
Different sized brushes and rods are available to match the caliber of the barrel.
There are flexibe cleaning kits available called a 'pull through', I am not a big fan of these.
Always use a rod that is made of softer material than the barrel (brass, alluminium, carbon fiber etc).
Specialist chemicals are available to disolve any bullet or powder residue left behind after firing which 'can', over time, build up and effect the rifles accuracy.
Some folk clean their rifles after every outing, I clean mine once a year although I always wipe them down prior to putting them back in the cabinet.
If they have been out in the rain and both of us are soaked I take the barrel and action out of the stock and wipe down, generally I don't.
I use Legia Spray and a bit of flannel sheet on my rifles (all blued) and Hoppe's No 9 in the bore.
I've never cleaned the bore of my .22LR, the 17HMR and .223 maybe twice in the last 4 years.
The .22-250 gets cleaned the most often, maybe twice a year.
I always take the moderators off the rifle and store them seperately.
Bolts are dry fired and left in the action.
https://www.ebay.co.uk/itm/327134646628
https://www.ebay.co.uk/itm/327134646929
Hoppes No.9 Powder Solvent (Synthetic blend) and other Bore Cleaning Solvents and Maintenaince Sprays available for Rifle Shotgun or Pistol
www.livens.co.uk
Legia Spray - Red (for Metal) - 750ml. Legia Spray is the ideal product for the maintenance and protection of precision gears. Being moisture remover, Legia Spray cleans, lubricates and protects firearms. It is the product selected by the best gunsmiths. Vaporize Legia Spray on the barrels and...
www.uttings.co.uk
Other retailers are out there ...
Other makes of cleaning rods and oils/chemical are available too, the above is what I do and I know works (for me).