It's a very basic task in any kind of professional embedded development.
Generally the hardest part is simply making sure that the device can wake up correctly and quickly enough under all situations. Also, tracking down unexpected power draws gets into a nice crossover between electrical and firmware design teams which can either be great or extremely frustrating for either side of that interaction.
I know it's been a problem on MacOS forever, like back in the 68k days. Some peripherals never come back from sleep and you have to power cycle them to get them to "wake up." And sometimes MacOS doesn't come back either.