Before painting, you must prepare, prepare, prepare. This is not a daunting task; it just means that if you want that professional paint finish, you need to prepare surfaces prior to painting.
Sometimes you will have to wash down walls with sugar soap, this will generally be required if the walls appear very dirty, or if they feel oily or greasy. If it is necessary to wash surfaces, make sure you rinse them with clean water to remove any soapy residue. Then you will need to rub the surfaces with sandpaper (usually 120 grit fine grade) to make them nice and smooth.
You may need to fill imperfections with a suitable filler, and then after the filler is dry, sand and undercoat these areas. The reason you would undercoat freshly filled areas is to seal over them to stop them being extremely porous when top-coating. If you do not “seal” over them, and apply the topcoats of paint directly over them, you will get noticeable “flat” patches over your walls or surfaces where filler was applied.
Apply a caulking compound to areas where surfaces meet if there is a “gap”, i.e. where walls meet ceilings, where walls meet doorframes or windows, where walls meet skirting boards etc.