The usual method is to keep the gun inside, don't get it near any dirty fields and refrain from using it for its intended purpose.

There a plenty of members on this board who can teastify to this excellent method of gun preservation.