IS there a proper workflow for ethernet, say for when it loses connection?

I am configuring the Ethernet in the Setup() method along with an EthernetServer and a MiniWebServer and then in the loop it checks for an incoming connection and processes it if a client is waiting.

I guess I am wondering what the situation is if I pull the ethernet cable out and then plug it back in to simulate a loss of connection.

Or what happens if the switch is turned off and then back on.

How would I know to reconnect ie run Ethernet.Begin again (is that what I am supposed to do?)

I guess it would be best for me to just test this out but I thought someone may have wrote an article about this before.

My project is an aquarium controller and the web server is needed on the arduino to read values and configure the system.

I have had issues where it no longer responds so I am just wondering about issues that could affect it.

My project is quite complex with around 35 different classes in separate .CPP and .H files

It controls 9 LED channels, a scheduler, a web server, and has temperature, humidity, and power monitoring capabilities. It supports easing functions for lights along with multiple points for each channel. I also have used a relay which turns on a battery powered air pump if the whole system loses power.

Just a work in progress but it seems to stop responding for no reason. I do not appear to have any memory leaks based on the free ram type of code.