What needs to be done depends on the model. Some models are Ubuntu certfied [0] and just work. They even sell some with it. Some need a little tweaking. I recently got a P14s Gen 2 AMD at work and all I really had to do was install the OEM kernel to get WiFi working and set sleep in the BIOS to Linux instead of Windows. Otherwise everything works.
[0] https://ubuntu.com/certified