And how does this generally affect the hardware?
While the phone is working, you can reset, this should not affect the hardware, if you do not reset every hour, but that is not a fact, you will just lose some of your data and customizations, reset as much as you want.
The answer to your question is simple - as many as you like.
In modern phones, memory is not the same as it was before. Now, in order for it to become unusable from a large amount of rewriting, you need to make so many cycles of recording and subsequent formatting that you simply cannot achieve this under normal conditions.
So don't worry about that. This will only take up your precious time, and you only need to do a reset when some problems appear, since this is the fastest way to get rid of them.
And about the methods of resetting and restoring you can read here .
There is no global influence on the phone's hardware from factory reset. Here the theory is drawn that it is impossible to format the memory many times, and yes, it is, but we are talking about hundreds, thousands of times ... And this is almost impossible under normal conditions !! Here are some of the pros and cons of a factory reset:
If you do not know your Google account and branded account, then after a reset the phone may ask for it. This is called FRP blocking
Reset deletes everything
Deleting everything will clear the cache and data from applications
While it is clean, the battery will last a little longer than usual
Phone is clean and working like new