1. Wait until the walls and the ceiling are dry. Give them at least a full day.
2. “Reverse tape,” applying tape to the edges of the walls and the floor, leaving only molding and trim exposed. When painting a baseboard next to carpeting, protect the carpet with a plastic paint guide (about $2), a long, thin strip that wedges under the baseboard.