to withdraw yourself from a module that you registered previously within the period in which withdrawal is legal, you should submit relevant documentation to related authority. This practice nevertheless leaves a W grade of that withdrawn module in your transcript.
As regards that whether you need to re-take that module or not, it depends on the nature of the module, i.e. if it is the essential module of your major. If it is not, it's not necessary for you to re-take it (This policy maybe had been changed). It won't affect your candidature of your degree or graduation.
However what I wrote here is merely derived from my past experience. It's strongly encouraged to consult your department or faculty secretary.