Do not use any attachment with a brush to minimize random static charge. You can use a specialty electronics vaccuum, portable wall powered vacuum or a full sized vacuum with attachments.
IF you've never done this, you need to disconnect all connections and completely unplug your iMac, find a heavy blanket or towel to lay your iMac, screen down on the soft material.
You can try just vacuuming all surface dust, lint and dirt from all over the outside of your iMac.