
bei
at / with
Indicates being at a person's place (at home) or at an employer.
Ich war gestern Abend bei Freunden zum Essen.
I was at friends' place for dinner yesterday evening.
at / with / near
Loading your saved state.

at / with
Indicates being at a person's place (at home) or at an employer.
Ich war gestern Abend bei Freunden zum Essen.
I was at friends' place for dinner yesterday evening.

while / during
Describes an action or state that takes place at the same time as another event.
Bitte sei leise beim Fernsehen.
Please be quiet while watching TV.

in / under
Indicates a circumstance or condition.
Bei starkem Regen fällt das Konzert aus.
In heavy rain, the concert will be canceled.

near
Indicates spatial proximity to a place.
Das Dorf liegt direkt bei der Autobahn.
The village is located right near the highway.

to have on one
A fixed expression that means to carry something with you or have it on you.
Ich habe leider kein Bargeld bei mir.
Unfortunately, I don't have any cash on me.
The preposition 'bei' always requires the dative. Make sure to decline the article and pronoun after 'bei' correctly.
Er wohnt noch bei seinen Eltern.
He still lives with his parents.
'Bei' is used to indicate a place in connection with a person (e.g., at their home) or an employer/company. It answers the question 'Wo?' (where?).
Ich treffe mich später bei Paul.
I'm meeting up with Paul later at his place.
To express that two actions happen at the same time, the structure 'beim + nominalisierter Infinitiv' (while + nominalized infinitive) is often used. 'Beim' is the short form of 'bei dem'.
Ich höre gerne Musik beim Joggen.
I like listening to music while jogging.
With 'bei', you can also describe a circumstance or condition. Typical phrases are 'bei gutem Wetter' (in good weather), 'bei Fragen' (if you have questions), or 'bei Bedarf' (if needed).
Bei Fieber sollten Sie einen Arzt aufsuchen.
If you have a fever, you should see a doctor.
The expression 'etwas bei sich haben' means that you are carrying something with you. The pronoun changes according to the person: 'bei mir' (on me / with me), 'bei dir' (on you / with you), 'bei sich' (on oneself / with oneself), etc.
Hast du deinen Ausweis bei dir?
Do you have your ID on you?
in
When talking about work, bei usually indicates affiliation with an employer. in refers more to the place or interior area where the work takes place. So a person works bei a company, but can work in its office or store.

Lena arbeitet seit Mai bei der Bäckerei am Bahnhof.
Lena has been working for the bakery at the station since May.
Lena arbeitet heute in der Bäckerei am Bahnhof.
Lena is working inside the bakery at the station today.