It takes,to realize how much you really need them in your life.It为形式主语,
to realize how much you really need them in your life为真正主语.
take的意思是:需要.
being away from someone for a while为动名词作宾语.
句意:要了解/意识到在生活中你需要一个人的程度需要离开他一段时间.
也可以意译为:只有离开一个人一段时间,你才能了解生活中你需要他的程度.