if it happens again. go to your command prompt, do ipconfig / ping your gateway address and DNS address
if your gateway fails this means there is a problem between most likely you and your local router.
if your DNS fails then its your DNS and really there could be multiple reasons why this fails. DNS is usually provided by your ISP DHCP server.
if DNS fails i would try power cycle your router (Power it off then back online) - this will update your router with ISP DHCP (there is another way but this is easiest)
if it continues after a power cycle then another solution can be to statically assign it. -you could use the google DNS if yours is down IP: (8.8.8.
.
but if you lose internet completely after restarting your router then ISP is having issues with there DHCP server. (DHCP provides you with a working IP address for their network - and other useful information like (Gateway), and (DNS))