Selection:
You need maintain a @State variable for selection and pass it to List's selection parameter as a binding
To restore selection state across app launches use @SceneStorage
All you need is shown in the video link below, watch it slowly and understand the concepts
Console Warnings
onChange(of: UpdateTrigger) action tried to update multiple times per frame
A NavigationLink is presenting a value of type "Category" but there is no matching navigation destination visible from the location of the link. The link cannot be activated.
Feedback has been submitted for the above mentioned warnings and Apple Engineers are aware of this bug, so you can ignore it for now
MacOS Sidebar
You can tap on the sidebar button to open the sidebar
I think there is an option in NavigationSplitView configuration, you need to check the documentation columnVisibility but I haven't mentioned to get it working
Reference:
Please watch https://developer.apple.com/wwdc22/10054
It has sample code to do exactly what you want (you can copy code by clicking on the code tab)