here is the steps.
1. Clean the area, scrape and sand any damaged areas and loose paint. If the old paint is dirty wash it with T.S.P or any good cleaner.
2. Fill any holes with quick drying putty or durabond and fill any big gaps with paintable caulking.
3. Mask the glass if you don't feel like you can get close with your brush.
4. if you use primer try tinting it close to your final color, use a sash brush for any grilles.
5. if its an older window make sure you don't paint the parts together.
6. when the paint is tacky run a knife over the edge and remove the masking tape