Have a look a this document which describes in detail how to configure Information Rights Management for SharePoint Online.
Set up Information Rights Management (IRM) in SharePoint admin center
Sign in to the Office 365 Admin Center
Choose Admin > SharePoint. You’re now in the SharePoint admin center.
Choose Settings. On the Settings page, in the Information Rights Management (IRM) section, choose "Use the IRM service specified in your configuration".
Then choose Refresh IRM Settings.
Go to the list or library for which you want to configure IRM.
On the ribbon, click the Library tab, and then click Library Settings (If you are working in a list, click the List tab, and then click List Settings).
Under Permissions and Management, click Information Rights Management.
On the Information Rights Management Settings page, select the "Restrict permission to documents in this library on download" check box.
To apply additional restrictions to the documents in this list or library, click Show Options.
That's it. You have now configured Information Rights Management to protect SharePoint Online documents - simple.