When paint bubbles on drywall it means that it's not adhering to the drywall surface either due to moisture, heat or some other contamination.
When painting drywall make sure the drywall is clean and no contaminants are on the drywall and if you notice any peeling paint or flaking paint on the drywall sand it smooth and make sure you remove any dust after sanding it by using a vacuum cleaner and a sponge with some water and dry the drywall off first.
Allow the drywall to dry out and then apply some primer to the drywall first and then after the primer dries then you can apply the paint again.
If you're still getting bubbles in the paint on the drywall then allow the paint to dry thoroughly and then, pierce the bubbles with a fine sewing needle.
After that flatten the bubbles by gently pulling a paint scraper across the painted surface and this will gently release the air from the bubbles and restore the painted look you originally intended when painting the drywall.