If clothes moths have settled in your closet, you need to get rid of them immediately.
There is a proven set of actions for this, consisting of 3 steps.
There are many reasons why moths may take up residence in your closet. It is important to take action immediately before the problem becomes too serious.

General cleaning
The first thing you need to start with is to do a general cleaning of the closet. If you have time and desire, you can clean the entire apartment or house.
But the cabinet must be unloaded and washed.
Washing
All items must be rewashed. The water should be hotter, but it all depends on the items.
Moths are afraid not only of high temperatures, but also of low ones. At -10°C the pest also dies.
Therefore, a freezer or an open balcony can be used as an alternative to hot water. After that, the clothes can be washed.
Strong odors
To block the pest's way into the closet, strong odors are used.
No one has used mothballs for a long time. Cedar, lavender, rosemary, cloves, thyme, bay leaf have replaced it.
The most effective option is to spray the corners of cabinets with anti-moth aerosol and, as a bonus, all the cracks in the house (joints of baseboards, door frames, floor coverings, etc.).