I generally use Denatured Alcohol on any but the worst almost caked on semi solid cosmoline queens. Some of those Commie Conscripts were VERY liberal in applying cosmoline to their weapons before long term storage....LOL
But the oldest and most dangerous method for removing caked on cosmo, but it works well, is gasoline in a metal container and a paint brush....just make sure you use a VERY small amount, OUTDOORS, and AWAY from anything flammable.
I cleaned up a LOT of old cosmo queen M91/30s like that....just try and remove any metal or plastic parts such as grips/stocks FIRST.
For particularly caked parts soaking in gasoline will do wonders, but for most I poured a little gasoline in a metal coffee can and brushed it on and the crud off over a metal catch pan.
But for GOD sakes do not smoke, or have soarks or campfires or whatever nearby
and rubber gloves are advised.
For the wood/plastic parts, 'Easy Off' oven cleaner works pretty well, but will also remove stock finish too.
But any good degreaser will work on wood, and again I generally use denatured alcohol.