What is the best way to consolidate 3 variables?

So, one of the basic “tennants” of proper programming is understanding the stack and how it works.
You can refer to this for a simple explanation of what it is and how it works.
https://c-for-dummies.com/blog/?p=2243

You are better off looking at C examples and learning from C programmers then looking this up in C++.
That is mostly because in C you have to do all of it almost entirely by hand - and if you mess up stuff doesn’t work - whereas in C++ the compilers tend to handle most of it for you by way of garbage disposal or other built in ways of preventing memory leaks.

The stack, how it works, memory addresses and therefore passing by reference vs creating copies is a rather big and important part of programming - even if you do use engines that take care of most of it for you.
You don’t necessarily need to understand all of it as much as the underlying concept of it. That page I linked should do a decent job at explaining it enough.

As far as examples of “by reference” Unreal uses the same classic CPP & symbol and * for pointers.

So, for instance, you could call a function with (int &VarName) to pass the value as a reference into the function and utilize it. There are also other variations like “& int”(no space) VarName - and I can’t recall which one works best for blueprint functions as I’m not in front of any code.
You should be able to find samples of it specific to what you need though. A decent example that you can draw from is any Quaternion library implementation, or any Double library implementation.