how do i create a password to open documents

email attachment asks for a password to open file?

You do not need to create a password - It has been created and applied by the sender of your email and opening the attachment requires you to know that password - and now the answer of @Hrbrgr comes into the play (just an general warning: Opening email attachments requires you to trust the sender of the email - otherwise you are at risk of catching a virus).

Ask your transmitter what password he has given.