This article explains how to set up double-tap gestures on Android 12 and later. Only Google Pixel 4 phones and later support the Quick Tap feature.
Tap Tap is a FOSS app for Android that allows you to perform a double-tap gesture on the back of your phone
With Quick Tap enabled, you can double-tap the back of your phone to activate certain features. To enable Quick Tap, follow these steps:
Open the Settings app.
Tap Quick tap (or Quick tap to initiate actions on Android 13).