Foremost means being at the very top or number one position.
When someone says that something is foremost in their mind, they mean it's the most important thing they're thinking about. For example, "Solving the problem was foremost on her mind when she woke up this morning." This usually implies that other things are also important, but this particular issue takes priority over everything else. It's like being at the front of a line or standing out in front of everyone else.
In a more general sense, something can be considered foremost if it's leading the way or setting an example for others. For instance, "The company that pioneered the new technology is now regarded as foremost in its field." In this case, the word is used to describe a position of leadership or innovation.
Positioned in front of (all) others in space, most forward.
