The nice thing about 24 hour races is that how you handle them is up to you. You do laps and your crew (if you have one), or the place you've stashed your stuff (if you don't have a crew), is at a set location - the start/finish area. Every time you come by the start/finish area you can stop if you want, or not. It's up to you.
You can rest as long or as little as you want. It is only 24 hours, so there should be no need for sleep, but if you want a bit of a break off the bicycle you can take it. However the more time off your bicycle means the less distance you get at the end.
If you do have a crew, you'll likely do better than if you don't because they can get everything ready for you and just hand it up as you go through the start/finish area. But if you are on your own, you'll have to get off the bicycle to get your food and more water. If that is the case, it's a good idea to arrange things in your bags, or in the back of your car, or wherever so they are easy to access.