I believe this works on Android in general, but I tried on GrapheneOS. Open the Settings app. Tap Security & Privacy > More security & privacy > App pinning. After that is enabled, if you want to pin an app, open it, swipe up into the recent-apps view, tap the icon of the app above the preview pane, and select "Pin".
The feature is buried a bit. I believe this is because it's more of a best-effort protection. The settings page itself says:
"When an app is pinned, the pinned app may open other apps and personal data may be accessible. If you want to securely share your device with someone, try using a guest user instead."