How I can encrypt RAM?

Sorry, but what do you mean by preventing apps from launching? Encryption is for data security, not to prevent apps from opening. If there are apps that are opening in the background that you never use and want to disable, then go to Settings>Apps, select the app, and tap Disable. This is for system or preinstalled apps only. If it's an app you installed, then you either have to uninstall the app, or use an app like Greenify to hibernate it.