the dentist will either put you on oral antibiotics (before preferably) or after the procedure (or both). in a worse-case scenario the dentist may postpone the procedure until the infection has resolved. you will need to discuss this with your dentist since every dentist will practice differently and make their own clinical judgments.
what if your broken tooth is infected when your ready to have the crown put on?