Before painting brick, clean it thoroughly with soapy water, use a roller or brush to apply a coat of latex primer, and wait for the primer to dry. Paint the brick with elastodynamic paint to fill cracks and prevent them from reoccurring. Regular acrylic latex paint may also work.
If the brick is new, wait at least a year before painting. Use a stiff-bristled brush to scrape off dust and efflorescence, and apply a bleach solution to clean organic matter. Allow at least 24 hours for the brick to dry before painting. Use a paint sprayer to paint the brick or a brush or roller if covering a small area.