If you have lost your App Store login details:
go to Apple support (or www.support.apple.com, Support menu > Forgot Apple ID or password);
follow the instructions.
If you have lost your Google Play login details:
go to Google support;
follow the instructions.