I issue with switch

Sometimes when I charge my switch it won’t charge I’ll plug it in for a couple hours and it wouldn’t charge at all but I will have to re plug it in for it to charge