Let me show you the way I was taught the four similar, but different in meaning, phrases:
In the beginning (+ nothing else) = At first; in the first place
In the end (+ nothing else) = Finally; at last
In the beginning, I didn't like my previous job, but I got to like it in the end.
At the beginning (of something) = At the point that something starts
At the end (of something) = At the point that something finishes
At the beginning (of the film), I was yawning, but at the end (of it) I got really interested, and my jaw dropped open!
___________________________
NOTE:

Bear in mind I'm not a teacher!
