If you have booked a railway reservation in any class by online but it is in waiting list then you can cancel it before confirm. If your waiting e ticket does not confirm after final chart then you are not allowed for travel on that e ticket.
After charting of passengers if your waiting e ticket does not confirm then your e ticket will be cancelled automatically. You don’t need to cancel W/L e ticket. The amount of ticket charge will be credited in your bank account from which you had pay for tickets.