@mathieu.brillon is correct. You should create a field on the Opp or Account record to load the attachment url to it. Attachments have an ID just like any other record in SFDC and you can create a formula to create its URL. Here’s an article from SFDC Support that shows how to do this in Classic (the url should be different for Lightning):
The example URL they used is: https://na1.salesforce.com/servlet/servlet.FileDownload?file=015300000000xvU
The ID in this case would be: 015300000000xvU
Here’s some additional details on how to create the url. The main thing you may want to do is ensure you grab the right url for the right document.
When requested from a valid session (i.e. after someone has logged in to salesforce) this URL (that includes the ID of the attachment) works:
/servlet/servlet.FileDownload?file=00PM0000001fH6h
If you create a text formula field on an object of this form:
HYPERLINK('/servlet/servlet.FileDownload?file=' + AttachmentId__c, 'View', '_blank')
the link can be displayed in default (layout based) UI. You will have to use an Attachment after trigger to store the AttachmentId on the object. The Attachment's ParentId tells you what its immediate parent object is and you can query as needed from there to find the object if it is not the immediate parent. (You need to decide what you want to do when there are multiple Attachments.)
But if you want to say email the link to a user that is not logged in to salesforce, you will need to use an "externally available" Document not an Attachment (though you could copy the Attachment content to a Document automatically in a trigger). Details on how to do this are provided in this blog post Salesforce: How to make a Document public?. This mechanism works for e.g. PDF as well as images.