The phrases at the beginning and in the beginning seem to mean the same thing, but there is a difference.

AT THE BEGINNING

At the beginning refers to a point in time, an instant, a specific time (or place) to describe the start of something. It is often followed by of.

At the beginning of his lecture, the speaker put an apple on the lectern.
The national anthems of the two teams were played at the beginning of the match.

A physician and a nurse performing surgery on a foot. The image is meant to illustrate the the difference between the phrases 'at the beginning' and 'in the beginning'.
At the beginning I thought there would be a lot more blood.

IN THE BEGINNING

The phrase in the beginning refers to a period of time:

In the beginning God created the heavens and the earth (Genesis 1:1).

The phrase is often used to contrast two situations in time:

In the beginning, I couldn’t understand what he meant, but when he showed a diagram, things got clearer.

And, since we have come to the end of this post, let me remind you that you can read about at the end and in the end here.