‘How do you do’ = an expression of greeting. It is used in spoken English as a polite way of greeting a stranger or someone you do not know very well. It is not used in written English.
‘How are you’ = an informal greeting. It is used in both spoken and written English.