It’s not pretty but if that hole is the size of a single or two-gang switch you can get a blanking plate meant for sockets and put it over it.
If you need it to be pretty I guess you can square the hole and/or cut a piece of wood to fit over it. Attach it somehow to the hole then fill the gaps with wood filler (look up how to fill a big hole in drywall).
If there’s a deep hole you need to fill you can also use spray foam.
It’s not pretty but if that hole is the size of a single or two-gang switch you can get a blanking plate meant for sockets and put it over it.
If you need it to be pretty I guess you can square the hole and/or cut a piece of wood to fit over it. Attach it somehow to the hole then fill the gaps with wood filler (look up how to fill a big hole in drywall).
If there’s a deep hole you need to fill you can also use spray foam.