Remove the baseboard cover so you can more easily work on it. You should be able to pop the cover off the baseboard heater.
Sand the rust away with a medium-grain sandpaper until you reach the base metal below.
Wipe down the baseboard cover with a damp cloth to remove any paint flecks or sandpaper residue. Dry the baseboard cover immediately with a dry cloth.
Spray an oil-based primer onto the baseboard cover and allow the primer to dry according to the directions on the can.
Apply at least one coat of oil-based spray paint. If needed, allow the paint to dry according to the package directions and apply a second coat.