Hi,
I wanted to cook dinner. I had the desire to cook dinner some time in the past. Yes.
I had wanted to cook dinner. I had the desire to cook dinner a long time ago. No. The distance in the past is not important. The Past Perfect is used to show that an event happened in the past before some other event or point in the past.
eg At 7pm yesterday, I cooked dinner. I started to cook at 7pm.
eg At 7pm yesterday, I had cooked dinner. Dinner was ready by 7pm.
Now let's look at a few of your original examples.
I wanted to become a painter. OK. tells me about a past desire.
I had wanted to become a painter. You need to say this in a context where it is before some other time in the past.
eg After I graduated from college, I got a job as an accountant. I had wanted to become a painter, but I discovered that I had no talent. This tells about a desire that I had before I graduated from college.
So, you need to study and practice Past Perfect. Would you like to try to write and post a few sentences for us to comment on?
Best wishes, Clive