I am learning English recently. Here is a sentence I am confused of:
Before going to bed, she assure herself that the door was locked.
May I ask what the part of speech is for "before" here? I think it's a preposition because it connects gerund, "going". I am not sure if my thought is right.