The printer works, then drops offline again every few hours or after sleep. This recurring pattern is nearly always a changing IP address or aggressive power saving.
Work through these in order; most people are fixed by the first two or three.
In your router, assign a fixed (reserved) IP to the printer's MAC address so the address never changes.
Printer properties › Ports › Configure Port › untick "SNMP Status Enabled". This stops Windows wrongly flagging it offline.
In the printer's settings, extend the sleep delay or disable deep sleep so Wi-Fi stays awake.
Move the printer closer to the router or add a mesh point if the signal is weak.
Browse step-by-step setup guides, error-code fixes and driver help for every major brand sold across the USA & Canada.