This guide outlines the steps I follow after a fresh Raspberry Pi OS Lite (64-BIT) installation on a headless RasPi. It assumes you have already installed the OS, enabled SSH, and successfully connected to your RasPi via SSH. While it works well for my purposes, your preferences and requirements might differ. Use this as a starting point and adjust it as needed.
After completing this guide you may want to check out my Headless Raspberry Pi Optimization Guide.