[REOPEN] : After 1 or 2 days serial port not working and need to restart device

The Serial port on your PC? Then that's a PC problem.

Your code uses both SoftwareSerial and Serial2. Which one stops working?

Which Arduino? Why are you using SoftwareSerial on an Arduino which has more than one Serial port?