You should first paint the ceiling, then the walls. If faster and easier to cover open areas like ceiling and walls, you can focus on painting the trims.