When you join a new company or team or group of people then there are unwritten office rules which everyone knows. But since you are new, it takes you some time to understand those.
Unwritten rules are learned in a few different ways.
By experience. All workplaces are different but they some share culture, domain, and socio-economic commonalities. If you've worked in one finance firm, others will likely be similar. If you've worked in one laboratory, others will be similar. If you've worked in one factory... you get the idea.
By having someone tell you. In healthy workplaces you'll develop working relationships with others who have been there longer than you. If there's trust and psychological safety in the relationship, it's OK for the mentor to warn you about rules which you may not know about. You're also able to ask hypothetical questions without fear of being "downvoted" stackexchange-style-- there's no wrong question if the relationship has trust.
By breaking the rules. This is the best way to learn and even the most experienced and savvy people do it. Breaking rules is inevitable. Most of the time the transgressions of unwritten rules are minor things that are easily forgiven. As long as you don't break the same rule over and over, there should be no problem if you're gracious and not aggressive about the transgression. This is why behavioral interview questions focus so much on conflict, they're trying to gauge what you're like when things don't go smoothly (eg when an unwritten rule is broken). Are you self-aware and able to absorb criticism and judgement with grace? Can you learn from mistakes and not hold a grudge? If yes, then you can handle breaking some unwritten rules (and tolerate it when others do the same).
Do some googling, get an understanding of what unwritten rules are out there in the world, then see which of them fit with what you see of your new workplace/co-workers.
In a 1-on-1 setting, at an appropriate point in your conversation/whatever you're doing, ask the person you're with "Hey, since I'm new, is there anything I should be aware of? Particular ways we do and don't do things? Anybody I should befriend or avoid? Any particular rules that tend to catch out new people?". Do that with several people and you'll very quickly get a good idea of what's going on.
The easy way to learn anything is to ask nicely. You will get a lot of information.
However, you have to be very careful when considering un-written anything - there might be very good reasons why it is not written. And the usual reason why rules are not written is that they are either immoral, unethical, or downright illegal. So it is very likely that nobody will tell you bout them.
So the best way is to always be cautious and politically correct. You might still hit an invisible rule occasionally and get hurt, but the chances are smaller if you are careful.