I use the following two lines to highlight extra white spaces and clean them with a leader shortcut on vim.
highlight ExtraWhitespace ctermbg=red guibg=red
noremap <Leader>c :%s/\s\+$//g<CR>