I am using SharePoint 2013 On-premise environment.
When I try to open an attachment of list item , it gives me an error "Connection refused".
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.Sign up to join this community
It sounds like your Office Online Server is not property configured, or is having issues.
When you visit a library and click "new document", does it open a new Word document in browser? (I.e. in Office Online Server)
If you know the name of your Office Online Server, you can check the status using: