We use 'ago' to talk about time in the past from now. It tells how long ago something happened.
I saw her two days ago.
The movie ended five hours ago.
Rarely, 'ago' is used with a past reference point, meaning before that past moment happened.
By 1900, the castle was built decades ago.
She arrived a week ago from when you called.
Rarely, especially in poetry or old texts, 'ago' can mean the past time itself, acting as a noun.
They speak of the ago with great respect.
In that ago, life was hard.