J.C. Penney Co. yesterday announced a $1 billion housecleaning designed to help Penney's compete with department stores and minimize direct confrontation with rival Sears, Roebuck & Co.

Penney's plans to throw out its automotive, appliance, hardware, fabric, and lawn and garden departments and restock its stores with more clothing, home furniture and leisure-time items such as sporting goods and home electronics.

As a result of the shift in merchandising emphasis, Penney's will dismiss about 8,000 workers, most of them in the automotive and appliance service departments.

Shutting down the departments will force Penney's to write off $58 million in profits this year and will require a $1 billion expenditure on new store fixtures and other remodeling over the next five years, said Chairman Donald Seibert.

Auto service centers will be closed some time this year at the Penney's stores in Fairfax and Springfield, Va., and Gaithersburg and Forestville, Md., and all nine Washington-area Penney stores will be remerchandised within the next two years.

The auto, appliance, garden supply and hardware merchandise that Penney's plans to drop long have been some of the most successful lines for Sears, the nation's largest retailer and Penney's most direct competitor. Penney is the nation's third-largest chain after Sears and the K mart discount stores.

Penney's traditional strength has been in the clothing and soft-goods departments that will be expanded into the space to be vacated by the hard lines.

Company officials would not say how much of Penney's business has come from the departments to be phased out, but they said profit levels from those items were "unsatisfactory."

Despite the 8,000 layoffs and $58 million write-off, Penney's stock on Wall Street gained after the announcement, jumping $3.75 on the New York Stock Exchange to close at $52.

Penney's will drop washers, dryers, stoves, refrigerators, air conditioners and the like. It will continue to sell specialized appliances such as microwave ovens and vacuum cleaners and will expand its successful TV and hi-fi sections.

The chain plans to gradually work down its stocks of merchandise in the automotive, hardware and appliance departments over the next few months and to complete the remerchandising within two years.

The Penney's catalogue will continue to offer some of the items that are being dropped, and Penney's will provide repair and warranty service on those lines at least for the time being.