Assalmu Alaikum brother… this not a straight forward topic to discuss though I will try and be as succinct as possible inshAllah.
“after formation of every human being in the womb of their mothers their destiny is written by themselves - how someone can be judged by something he/she did not chose to do or be?”
“Destiny” is understood to be our future and “written by themselves” means the action of a human being undertaken by him/herself. Where you are asking, “how can someone be judged by something he or she did not choose to do or be” is incorrect because the saying of “written by themselves” is precisely saying the opposite. If a persons destination is Jahannam or Jannah it will be due their own actions. Hence we need to look at ourselves and our actions and try our utmost to save ourselves from Jahannam and enter Jannah.
As for how to understand, “Allah guides who He wants, so how can we blame someone by not being righteous or Muslim?” we all know hidayat comes from Allah (swt) that should be the premise of this discussion. However if you read up the rebuking of Muhammad (saw) by Allah (swt) in Surah Abasa when he (saw) ignored Abdullah ibn Umm Maktum (ra) since rasoolullah favoured talking to the Quraish who were the pinnacle of Makkan society and thus very important, yet they were not interested in Islam, rather then talking to a blind man who was interested in Islam, Allah (swt) makes it clear that belief is a “willing” action though this willingness comes with guidance which is from Allah (swt) since He (swt) also tells rasoolullah that there is no accountability on him (saw) for people who don’t believe. Furthermore Allah (swt) says in Surah Al Baqara verse 7, "Those who have disbelieved — it being equal to them whether you warn them or warn them not — they will not believe. " So we know Allah (swt) guides whom He (swt) wills but guidance comes with willingness to acceptance on behalf of the person seeking guidance.
And Allah (swt) knows best.
Your brother in Islam