What have you tried so far ? Knowing what you did would be helpful to narrow the explanations down ?
There are two main drivers you can use in the mail settings:
mail (default): your webserver will take care of sending emails to the world. If you use a shared hosting this might work fine, but often emails will be blocked by the hosting company or internet provider because it's an easy way to send spam.
smtp: configure a relay for your emails. The company that hosts your website might give you the details you need to enter there to use their own relay server. If they don't have any or you don't want to use them, you can use third-party relay servers like Mailgun (that's the one I use, but there are many other). These SMTP relays usually take care of signing your emails correctly so they are not flagged as spam by internet providers or recipients.
Hope this helps ?