If you set it to unrestricted under battery settings on the app, that removes it from availability in the "never sleeping" app.
I always put apps in the "never sleeping" section on management before I change it to unrestricted in the app's battery settings. Not sure if that leaves it in the never sleeping table. But, it does seem to automatically be there when I turn off unrestricted.
Here is the process I follow for critical apps
1- For battery optimization,
Go to Settings -> Battery and Device Care -> Battery - Background Usage Limits
Once there, ensure that "Put unused apps to sleep" is toggled off. Then tap on "Never Sleeping Apps". Hit the "+" in the upper right, then scroll down to find the app. Select it and then "Add" at the bottom.
2-For memory optimization, Go to Settings -> Battery and Device Care -> Memory and tap that section. Go down to Excluded Apps, and select that. If your app isn't listed, click the "+", scroll down and select it.
3- Unrestricted Usage
Finally, go to Settings -> Apps-> Scroll down to your app and click it. Go down to the Battery section and click that. Select Unrestricted and then back all the way out.
NOTE: If you did this first, you will NOT be able to add it to Never sleeping apps in the previous steps. This step will hide it from that menu for some reason.
4- (Apps other than Android Auto)- You can Pin to recents to keep them open in the background.
Open the app, then go to your home screen (WITHOUT CLOSING THE APP). Click Recents. Scroll Through till you see the app you want to keep running. in the top of that app, you will see the icon for the app. Tap THE ICON once to get a drop down menu and select "keep open". This usually survives reboots. However, you should check after reboots (ESPECIALLY AFTER UPDATES) and redo this as necessary. I only do this with one app that I use for home automation and is critical to stay open.