Shuffling a card from your hand into your library is mandatory. The effect says “if you do” because performing that action might have been impossible. If you fail to shuffle a card into your library because your hand was empty, you won’t draw any cards.