At 22:30 you may find the other people in the compartment still awake, especially if the reservation notices mention people joining in that location, or you may find people already asleep.
It is even possible that you are the first people in and others will join later in the trip, or some already in and others join later.
You can knock on the door but in my experience that is more for the train staff who enter between stations, the people in should expect people joining at the stops and not be in a state of undress.
Some people will lock the door of a compartment whether or not others are expected to join, and if you find the compartment door locked and no reaction on knocking, you ask one of the train staff to open the lock for you, (they should always have a key that allows for that.) When all occupants are in and you agree to it, (or someone takes the action and does not allow other people a say) the lock can stay on through the night, staff has that key to get in. (But so do have some thieves who specialize in in-train crime, so still take care of your things.)
When you get in a compartment with some people awake, try to communicate and work out a bedtime. If not possible to talk, do your own thing at your own time and hope the others agree with your lights out time. (You can always initiate the lights out when you are clearly ready for bed, allowing it to go back on for a short time for the others to also get ready.)
Once the main lights are off, use your bedside night or your phone or torch to make a small light on your bed, use that light to do whatever you (still) need to do near the bed. Keeping sounds down. And asking others to keep sounds down as well.
If others are expected to come in after you and you can stay awake till then, it is perfectly alright to get ready for bed before that station but keeping the main light on, or to keep sitting up with the main light on and/or the curtain open. (I love looking out, inside dark.)
I always kept my personal valuables in a bag under or at least near my head, some people still wear their valuables belt. Others do not bother and keep things in a bag on the floor or in the luggage storage area above the corridor.
Normal luggage should be stowed under the beds or above the corridor, or if all those places are full, near the window end of the compartment as long as they do not block the stairs to the upper berths. If you can travel with minimal luggage your travel mates will love you for it.