which one is correct ?
You would say "at the beginning" of a process or a period of time. You would say "in the beginning" of a situation, a relationship, or of course the Bible. For instance: "At the beginning of term, all the new students were nervous." "At the start of the meeting the chairman welcomed everyone." "In the beginning Sarah and Geoff didn't like each other much".
Much depends on the context, and sometimes you can use either. However, here are a couple of comments.
"IN the beginning" Treats the beginning as a period of time, or something having length. 'In' means at some point(s) during that.
"AT the beginning" 'At' refers to the first point of beginning.
The Bible says In the beginning, God created the heavens and the earth. The idea is that it took him a little time to do that. On the other hand, at the beginning there was nothing.
In The Sound Of Music, Julie Andrews sang Let's start at the very beginning, a very good place to start. When you read you begin with ABC, When you sing you begin with do-re-mi.