This functionality is comprised of multiple components – you need to build the interface, keep track of which visitor follows which events, potentially do something with that information and change up the display depending on the current time.
The first thing you should do is clear up the requirements – what happens when someone follows an event? What happens when someone clicks on "attend"? How are event follows attributed to people across sessions – with cookies, with a login system? Maybe all that stuff is in your head, but since you don't mention any of it it's hard to give a useful answer. And if you can't explain this feature concisely in a way that makes sense to someone unfamiliar with your project, odds are you don't fully understand the problem yourself.
That said, here are a couple of pointers to get you started:
On the front-end i have a list of card "Events" and each card has a "Follow" button to follow the event
I assume you want to keep track of which people follow which events. First you need to determine how to identify visitors. If your visitors are logged-in Craft users, that's easy, but for anonymous sessions you need some other method (like setting a cookie).
Check out the documentation on Controllers to get started.
when the "event" time is on the word "follow" will be replaced with "Attend" after clicking the btn, if it makes sense
That's easy, in your Twig template for the event page, simply check if the event is currently active (i.e. the current time is between the start and end time of the event) and display the follow or attend buttons accordingly. Of course, the real question is what happens when either button is clicked – again, this is something you have to figure out as part of gathering requirements.