Is it necessary to shutdown and unplug the power cord of Mac Mini every night?
While there are many opinions on what you should do and when you should do it there is no technical reason why you need to unplug your Mac when shutting it down at night. In fact you don't even need to shut it down at all.
I have a Mac Mini that is attached to my main TV. It stays on all the time. I have a MBP that I never do anything more than shut the lid and let macOS decide what to do (usually just sleep/hibernate).
The only reason I can see to unplug your Mac would be that you have a lot of issues with power in your area. In other words there are frequent lightning strikes, the power coming into your place is "dirty" (EG it varies a lot in voltage, there are spikes and dips that could damage anything plugged into your place's power).
And note that the average household has a lot of devices with computers in them (TVs, Microwave ovens, video game consoles, smart home devices, etc.)that are always plugged into power. If they have not been damaged by the power in your place it is unlikely that your Mac will.
Me, I'd leave it plugged in and then either sleep it or shut it down, whichever you prefer. It won't hurt to unplug it but (excepting the issues I just outlined) it also is unlikely to hurt to leave it plugged in.
As a general rule, you don't need to unplug your computer if your electrical installation and power supply provide power which complies with standard power quality rules.
However, if you have low power quality in your home or office (i.e., grounding is not appropriate, or there are frequent surges and/or dips in power -- that you could see as sudden changes in the intensity of your office lights, for instance), it is advisable that you do this while you are not using your computer. That also removes the small amount of power that will be consumed by the computer to allow for it to be quickly started up.
But if you are indeed concerned with power quality, you should probably look into buying an UPS, to avoid issues with electricity affecting your computer.
Incidentally, if you are really using your computer only at given hours, and you leave it connected, you can program your Mac so that it shuts down or starts up at a time of your choosing.
There is no reason to even shut it off. I've been using Mac minis since the first model came out, I must be on my third or fourth and getting ready to buy an M1... and I have run them 24/7 for most of the last fifteen years. I'm running two right now, one sitting in the corner as a server.
I can see my main one has been up for
18:45 up 36 days, 5:37, 9 users, load averages: 2.94 3.41 4.47
and I just rebooted the server recently
18:45 up 7 days, 3:37, 2 users, load averages: 3.08 3.22 3.24
The one thing in the older models that might have the most potential to wear out is the hard drive, or perhaps the fan, but today's hard drives are SSD and from what I've seen online, the fan barely runs.
Of course, you can if you want to - to conserve energy, or if your local power is inconsistent and you're concerned about power spikes. For the former, just set your Energy Savings so it goes to sleep which should shut down the monitor automatically, and for the latter... if you're that worried, what about when you're using it? You'd want a UPS or good surge protector for that.