At the beginning of an encounter, each character that is not surprised rolls a D20 and adds their Initiative bonus. This determines the order that characters will act in for the remainder of the encounter, unless some power or effect modifies a character's Initiative result later in the encounter.
If any creatures were surprised by the start of the encounter, they do not roll Initiative at this time. Instead, they roll Initiative after the last creature who already has an Initiative roll has gone. This first round of combat is called the "Surprise Round"; if no creatures are surprised at the start of combat, there is no surprise round.
If a surprised creature loses the surprised condition during the surprise round, they roll Initiative immediately upon losing the surprised condition. If they roll an Initiative higher than the currently acting creature, their Initiative result is treated as directly below the currently acting creature's Initiative, and they will go next.
Certain feats trigger off of rolling Initiative; if you are surprised, you may not activate these triggers until you actually roll your Initiative.