To encrypt and decrypt files using OpenSSL, you need to choose an encryption algorithm (e.g., AES-256) and specify the file you want to work with. For encryption, OpenSSL allows you to secure the file by using a password, and for decryption, the same password is required to restore the original content. The process involves using OpenSSL’s commands to define the encryption mode and the input/output files. Adding options like a salt can improve security by preventing patterns in the encrypted output.