Once you have found accomodation you must register with the municipality in the Municipal Personal Records Database (BPR). The citizen service number (BSN) is a unique personal number matched to everyone registered in the Personal Records Database (BRP). Everyone who registers with the BRP is automatically given a BSN.
Any government service in the Netherlands is connected with your BSN. It is your tax and social security number. When you want to work your employer asks for your BSN for reasons of tax, health care system you are asked for your BSN, and in education your BSN is also used, even if it is named PGN here: The digits are the same.