Yes, you can use an enclosure, many people do.
PSA: Whatever you use for an enclosure, please take precautions for the potential of fire. Have a smoke detector within the enclosure or nearby. Resist the temptation to leave your printer unattended, give yourself some method for remote viewing (ex: RaspPi + OctoPi + RaspCamera). Even with a tuned printer things still go wrong.
In the long run, you will be better off with a purpose-built enclosure. The primary goals of a good enclosure are visibility of an active print, access to the changing print filament, and heat control (stability). Together these imply a large doorway and windows. The goal temperature to be held within your enclosure is roughly 30-50 °C.
A wardrobe is likely a thick material and will hold higher temps, and is not see-thru, making it an undesirable enclosure. DO NOT USE cardboard, unless you want to tempt fate. Aluminum foil, though flame resistant, is not sturdy and makes for poor visibility of the print. In short, don't be super cheap-o here.
The concerns of equipment overheating are mostly for the power supply and controllers (ex: RaspPi). I suggest to detached them, placing them outside of the enclosure. Again, a wardrobe may be too big for the controllers & power supply to be outside and still have the cables reach the printer components. If your enclosure temp never exceeds 32 °C (90 °F), you could possibly get away with leaving the equipment attached and inside.
Once you have an enclosure for your 3D Printer, determine if your enclosure needs vents. Get yourself a small thermometer and track the internal heat near the roof, during a long-running print. Add passive vents to the corners if the temp reaches 45 °C or above. Avoid active fans, as flowing air will lead to warping & separation of prints from the bed. Your goal is to have a stable temperature around your printed plastic.
For reference: The particular enclosure I'm using is a simple clear Acrylic box, with a few small vent holes, measuring 18" wide x 24" long x 18" high, barely big enough for my 3D Printer. I'm running an Creality Ender 3 v1, typically with ABS using 220 °C for the hotend and 100 °C for the bed. The enclosure internal temperature rises to 35 °C, starting from an ambient room temp of 20 °C (68 °F).
The acrylic makes for a sturdy box, the print progress is very visible, large easy doors and provides moderate insulation. Cost was roughly ~$75 total for 5 sheets of 18" x 24" x 0.093" acrylic (left, right, top, front, back) @ 14\$/ea.
Hope this helps and best wishes.
P.S. External link to examples of many 3D printer enclosures (some good, some bad): https://www.instructables.com/workshop/howto/3d+printer+enclosure/