I can never remember how to automatically connect to my bluetooth headset so here is a very short recipe.
Make sure your bluetooth headphones are already paired and trusted. Then proceed according to the sound server system you’re using (PulseAudio or PipeWire).
Assuming you are using PulseAudio, edit
/etc/pulse/default.pa as explained here and add the following to it:
1 2 ### Automatically switch to newly-connected devices load-module module-switch-on-connect
See this post for the equivalent PipeWire configuration.
Now, the next time you switch on your bluetooth headphones, they will automatically connect and become the default device.