Suppose, a user story has further divided into multiple tasks; if the tasks are having dependancies among themselves then how to make sure that productivity stays stable? I have read that we have to either slice user stories vertically or split user story. How vertical slicing works?
The direct answer to your question is that vertical slicing of user stories focuses on deliverable value in each story instead of layered stories that only deliver value when they are all done.
As an example, let's say you have something like this:
As an apartment resident, I want to file a request for maintenance online so that I don't have to wait for the office to be open.
I could have tasks like this: Design data object and create tables in db, build front end, build web service, build auto caller feature to call maintenance.
However, until these were all done, I wouldn't get anything. Instead I could create a form where you put in your appt number and it sends a text or call to the on-call maintenance person. Now I have a usable (if limited) feature. Next I allow you to add extra information about the request, adding those fields to the form, web service, database, and maybe into the call. Finally, I might add nice-to-haves like time of day for maintenance to come by, urgency, tie-ins to maintenance history, etc.
The difference is that in vertical slicing, each version is (potentially) usable.
This is a really short answer to a complex question. Richard Lawrence has a great blog post on it here and at the bottom of the blog post is a great infographic on different ways to effectively split user stories.