For the best user experience, clicking the Like button should send an AJAX request to the server. The server side script can add the Like to a running total somewhere. Where depends on what is being liked. If a post, post meta is a good place.
Depending on how important it is to prevent voting fraud, the server side script should take some measure to prevent one person from liking the same thing multiple times. It’s probably impossible to fully protect against fraud, but requiring users to be logged in and keeping track of their likes in user meta would go a long way.
Some folks have leveraged the comment system into a Like Button feature. I’m not sure it’s worth doing so. If you write your own code then you know exactly what it’s doing. I assume that is in part why you do not want to use a plugin.
A nice touch would be to have javascript increment the count shown on the page (if there is a count) after the vote is registered server side. If nothing else, a brief modal thanking the user could be shown so they know their vote was registered.