We will be in the midst of others in Olam Haba.
יקבצו הטובים ויעשה מהם כלל א' שלכלל ההוא יעותד העה״ב בטוב האמיתי המושג
בו
The good ones will be gathered and made into a group. For the true
good that is attained in Olam Haba is destined for this group...
'שתכלית כל הענין הוא לקבץ קיבוץ שלמים שיהיו ראוים ליקבע לנצח בהתדבקותו
ית
...The purpose of the whole matter is to gather together a group of
Perfected Ones who will be fit to be established in an eternal state
of intimacy with Hashem.
Derech Hashem 2:2. Derech Hashem 1 and 2 both cover this in much more detail, although of course there are many secrets involved.
How can a person ensure Olam Haba for another? I'm not sure about ensure, there's only so much the Tzaddikim can do, but we do daven every day that we should merit to attach to them in Olam Haba by saying וְשִׂים חֶלְקֵֽנוּ עִמָּהֶם, and place our lot with theirs.
The secrets of this are beyond our comprehension. However, a small drop has been revealed to us by the Ari Hakodesh T'zl through his student R' Chaim Vital T'zl, in Shaar Hagilgulim, and the souls of the less worthy are able to become attached to the souls of the wholly righteous, thus attaining eternal life through them. Building off the pasuk in Shmuel 2:14:14:
לֹא יֵאָסֵפוּ וְלֹא־יִשָּׂא אֱלֹהִים נֶפֶשׁ וְחָשַׁב מַחֲשָׁבוֹת
לְבִלְתִּי יִדַּח מִמֶּנּוּ נִדָּח
God does not take away life, rather He devises strategies in order
that the banished ones should not be banished.
This is very complex and there is a lot of nuance, but even those who are unable to bring a tikkun to even one limb of their soul are still not completely cut off, but have their good distributed among the souls of others (see 4:6).
See also Sha'arei Ramchal, chapter 106 (thanks to fulltimekollelguy for the image).
Shaar Hagilgulim also gives us a general impression towards the title question, that we will, to whatever extent possible, placed with souls similar to us, and that means we are more likely to be with friends and family than not, although again these are very secret matters, and it is clear our merit plays a big role in this. How this looks in practice is going to have to be a surprise!