To add onto it the do-not-track header can be used to signal an opt out. There needs to be a browser wide setting that is communicated to websites without user interaction. Some German court even ruled that Linkdin IIRC has to respect DNT for that.
The law is good, but websites implement it badly on purpose to inflict consumer ire towards the EU. There's good money to be made if they manage to make the voting public hate the cookie banners so much the anti-tracking legislation gets repelled
It was with the best of intentions but cookie banners have done more to hurt web browsing than anything else in the last decade