theming – How do I pass a node field variable into a layout builder section template?

So far what I understand is I need to start with this:

function mytheme_preprocess_layout__twocol_section

in my .theme file, but I’m not quite sure where to go from there.

For clarification, I have a term reference field on my content type. I’m trying to pass values from the term (specifically, an attached menu) into the layout builder section template so the node displays the correct menu depending on the taxonomy selected.