Horizontally centering objects

Anyone have advice for trying to center two objects on a screen that are on the same level horizontally?

For instance…I’m wanting to have a line of text and an icon to the right of that text. The text can be of variable length.

Example:
“Username” + Icon

Hi @Michael.
I have done it this. It was important to be the same type of component, e.g. both buttons or both images.