locked out of my iphone
hi everyone i have a problem with my iphone at first i bought this iphone from a relative but they forgot their icloud password i figured it out and got to reset it but when i try to sign it out of my phone to use my own icloud it wont i searched a little on the internet i found out that resetting it might delete the account from the device but now i have the apple id and the password but it wont let me in for once it says the account has been disabled for security reasons and then it became wrong icloud account i checked on my pc i found that my iphone is still connected to the old icloud but i couldnt get in in any possible way please help me !
iPhone 13 Pro Max, iOS 18