When your Visual Tree Asset is ready and you have already attached it to UI Document on a Game Object, simply add UI Events Selector (located in UI Tookit > UI Events Selector) to a Game Object with that UI Document.
From here add element to your UI Events Selector and pick element directly or build a query that will target all elemenets matching it.
Now building query supports picking name and class in a type safe way from a list.
Note: you can specify multiple classes, separating them with comma, but this doesnt mean that it will pick elements having any of the classes, BUT rather elements having all the specified classes.
Next step is to choose what event type to register and assign a callback to it. If you want, you can always add more events.
If you made a mistake, or want to organise inspector in your way, you can always delete and rearrange elements.