了 after a verb is when your action is accomplish like : “我看了这本书” i have read this book, the action is finish.
了 in the end of a sentence : When you have a change of state like, “上课了” the class just start, you can use it in the end of a sentence when you’re in a new state like, “now i’m a teacher”, “i’m not sick anymore”, “class is finish”…