Chosen Solution

the screen wont work on samsung z flip , most of the screen is blacked out but i can still see some parts of my wallpaper like the top and bottom corner of the screen. anyway theres a lock code (swipe) and i am unable to unlock the phone. is there any way i can retrieve data from that phone or is there anyway to remotely remove the lock or bypass lock screen? Thanks

Log into your Google account on a computer and find the device and remove the password. Only problem is you still need to use the screen on the old phone.

In addition to @strongbow’s answer to retrieving your data, it sounds like the screen is broken. To avoid buying another phone, I’ve attached a guide for replacing your screen here. I would also try to reach out to your warranty provider, or Samsung, to see if they can supply you with a replacement screen. Otherwise see if you can find a screen second hand.