At the beginning is used to refer to the start or first part of something. It is usually followed by of, and it used in situations with a clear beginning and end (a year, a class, a chapter, a book).
In the beginning means ‘at first’, and it usually suggests a contrast with a later situation. It is not usually followed by of.