Hi miro163,
welcome to the Apple (user-to-user) community!
Re: "Can’t use my laptop after putting the password"
Commiserations! Am no expert in this area, yet your post certainly deserves some response. Seems you have tried a few things already ... see if any of the suggestions below could be helpful.
Re: "When i power up my laptop everything starts normally but after I put my password it just stays on the screensaver view".
Seems Mac needs you to press a key to move beyond the screen-saver, or is it waiting for you to choose which user-account you want to use ?
or
You may want to check the power-point you are using isn't faulty, (eg: by trying a different one) ... and try checking the Mac's power-adapter is working properly.
Else:
Wondering if something in Apple's Support's online article (link below) may help:
If your Mac doesn't start up all the way - Apple Support
____________________________________
If nothing above has helped:
It may help if you try starting up in safe mode:
See: Start up your Mac in safe mode - Apple Support
Note: You leave safe mode by restarting your Mac normally
(Eg: Apple Menu / Restart).
____________________________________________________________________
Re: "I reinstalled the Sonoma but it still doesn’t work".
Wondering: If an error occurred while updating or installing macOS - Apple Support
_________________________________________________________________________
If you need more help or support than appears here in your discussion thread:
There's an Apple support web-page with info. / support / contact options
(Eg: see the "Get support - start now" link (online chat / phone / email) at the bottom)
MacBook Pro - Official Apple Support
or you can talk with the experts at an Apple Store if you make a reservation:
They will look at your Mac, and advise you on the situation. (If any expense is involved they will give you a quote. They would need your approval before doing anything if needed.) Genius Bar Reservation and Apple Support Options - Apple
All the best :-)