If you want to leave a certain app always running in the background:
Go to your recent apps > choose the app you want to keep open > press and hold the icon on top > press keep open.
The keep open feature won't matter if auto optimization kick in, it will still close the process in the background
That doesn't answer the question on how to turn off auto optimization. To answer the question, it appears that Samsung has taken that choice away as well and users can no longer decide NOT to use optimization on their devices if they want. Scheduled Auto Restart is a totally different thing that Samsung, in their infinite wisdom has also taken away despite overwhelming response from the Beta testers that they should not. So, why even do a beta test if you aren't going to listen to the feedback? But, I digress....
Aside from all that, and to at least partially answer the original question... While you can no longer globally disable optimization, you can at least take the following steps for individual apps:
Open Settings -> Battery and Device Care -> Click Battery then select Background Usage Limits. You can toggle on or off "Put Unused Apps to Sleep" (I run it off). Even with it off, I open the "Never Sleeping Apps" and add the apps I want to allow to run all the time to the list. (Note: You should do this before adjusting the individual setting for "Unrestricted" below, as unrestricted apps will not be available to choose. If you are not finding your app here, go to the last section and open the specific app and change it back from "unrestricted" so that you can add it here.)
Next, go to Settings -> Battery and Device Care -> Click Memory and click "Excluded Apps" Hit the "+" button in the upper right, and add any apps you do not want to be closed when they are running in the background.
Lastly, for each app you want to exclude from optimization:
Go to Settings -> Apps - > Scroll to the App in question, OR Long Press on the app icon from the app tray/home screen and Click the "i" in the pop up menu
After getting in to the individual app info screen -> Tap on the "Battery" usage block. That will open a screen where you can select "Unrestricted", "Optimized", or "Restricted", I choose unrestricted for ones that are critical to remain open. That excludes the app from being optimized.
My device has 16 gigs of RAM and it's closing applications even with all the solutions presented here, and this didn't happen at all before the upgrade to one UI 5.
Please post a fix if you find one.