RE: I am trying to access restlet using suitelet both are in different companies it throwing an error “invalid login error”
This is expected if you are not using any authentication. The correct way would be that you use TBA and OAuth.
Also, you must use the full URL of the Suitelet along with correct account id. Create a TBA in the account where RESTlet is there, use that token in your Suitelet in your other account (may require crypto and other libraries to access) and then perform whatever you are doing in the other account in the RESTlet.