How to distinguish between 吧 and 嘛, 罢 and 嘛
Well, in our normal life, 吧 is usually used for the moments when you are guessing/questioning/acquiring/normal words ending/agree....
吧 can be used in many situations.

But 嘛 is a little kind of "spoiled", totally used between friends and girl/boy friends, also used for acquiring, not used for guessing. It's sometimes used when you are angry. “好嘛，你竟然骗我！”

罢 is a little kind of "compromise", or "have no choice". It's usually used in literature; it's not normal to use it in daily life.