Merhaba,
I am trying to say this : I went to a friend of mine who is doctor.
My tries :
Doktor olan bir arkadaşıma gittim.
Doktor olduğu bir arkadaşıma gittim.
[...]
When you make relative clauses, you pay attention to one thing:
If the noun on which you introduce the relative clause is the subject of the clause, then use -en/-an.
In your sentence:
I went to a friend of mine who is doctor.
You introduced a relative after the phrase "a friend of mine". All right, and who is the subject of the relative clause? (Who is the doctor?) A friend of mine. So it's also the subject of the clause: You use -en/-an.
--------------
The reverse case is when the word is the object of the relative clause. For example:
The book which he reads is boring.
I've introduced a relative claused after "the book", but we should also determine the subject of the clause:
Who reads? -
He reads. So, the subject of relative clause is not the book. In that case you use "-diği" + possessive of whichever person is doing the action. In this case it's the 3rd person, so no ending:
Okuduğu kitap çok sıkıcı.