pedir vs preguntar
Preguntar is asking a question. Pedir is asking for something — a request, an order, a demand.
pedir
To request, to order, to ask for something — you want something from someone.
Pidió un café con leche.
He ordered a white coffee.
Ordering food and drink is always pedir. Never preguntar.
Te pido que me escuches.
I'm asking you to listen to me.
Pedir + que + subjunctive for making requests of people.
Me pidió perdón.
He apologised to me.
'Pedir perdón' = to apologise. A fixed phrase — you're requesting forgiveness.
preguntar
To ask a question — you want information, not a thing.
Me preguntó cómo me llamaba.
She asked me what my name was.
Seeking information. Preguntar + indirect question.
Pregúntale a él, yo no sé.
Ask him, I don't know.
Directing someone to ask elsewhere. Always preguntar for questions.
Me pregunto si vendrá.
I wonder if he'll come.
Preguntarse = to wonder. A reflexive use that English speakers often miss.
Tricky bit
'Ask him for the bill' = 'pídele la cuenta' (request). 'Ask him what time it is' = 'pregúntale qué hora es' (question). The English verb 'ask' covers both — Spanish doesn't.