Hi furkat,
This Apple article tells you what to do if you have forgotten your password --> If you forgot your Apple ID password - Apple Support
or go directly to this link --> http://iforgot.apple.com/
I am getting the impression you may not have a trusted device or phone number either. You can look into adding more ways to get a code such as multiple telephone numbers where you can receive a text or a phone call. The document
Check your Apple ID device list to find where you're signed in - Apple Support
tells you how to do this or you can manage your trusted phone numbers, trusted devices, and other account information from your Apple ID account page. Click here -->
https://appleid.apple.com/
If you had set up an Account Recovery Contact ( Set up an account recovery contact - Apple Support ) you can get a code that way.
If you can’t sign in, access a trusted device, reset your password, or receive verification codes, you can request account recovery to regain access to your account. This article explains how to recover your Apple ID after a waiting period - How to use account recovery when you can’t reset your Apple ID password - Apple Support
If you still need help:
Contact Apple for help with Apple ID account security "This article provides country-specific Apple Support contact information for customers seeking help with their Apple ID password or other security-related issues." --> Contact Apple for help with Apple ID account security - Apple Support
Also read about "What to do after [or before] you change your Apple ID email address or password" --> What to do after you change your Apple ID or password - Apple Support