I would like to confess to a priest but not sure if I can do that before getting baptized.
Can. 842 §1. A person who has not received baptism cannot be admitted validly to the other sacraments.
A person first needs to be baptized before they can go to confession. Baptism forgives all sins, confession is only for those who sin after baptism.