Here's my experience on harescrambles (I started racing 2002 in Junior class, now I race expert so I like to think I have any idea of what I'm doing):
Here's my recommendations:
-Make sure your bike is well maintained. By that I don't mean it looks brand spanking new, but it should run well and everything should work at the beginning of the race (kill switch, brakes, etc).
-Have a good helmet, goggles or safety glasses (good for mud races), boots, gloves and preferably a chest protector and knee guards. I didn't have a chest protector when I started racing, but bought one after 1 race. They're definitely worth the money.
-For offroad, buy a drink system. You don't need anything fancy, just something with a reservoir, hose and bite valve. I use an ancient (10 year old) camelbak and it works great.
-I'd also recommend getting barkbusters if you're racing harescrambles/enduro/offroad. You'll pretty much never again break a lever, it saves your fingers in the woods and lets you bounce off trees easier.
-I recommend showing up early to the race. I like to get there early and just relax and bench race with other racers. The atmosphere at most races is really friendly so don't be shy, go talk to some people. Signing up early is also a good idea as most events offer a t-shirt or something to the first X number of riders. Souvenirs are always nice!
-Go to the rider's meeting. This is absolutely mandatory for new racers.
-Once the race is starting, get to the line and line up on your row. When they start the race (air horn, gun or for motocross, a starting gate), take it easy. You can't win a race in the first hour, but you sure can lose one.
-On the same idea, PACE YOURSELF. I get a kick out of the new guys. They go really hard for the first hour or so, then they're toast. I like to finish stronger than I start, so I'll hang back, take it easy for the first hour or so (keeps my arms from getting pumped up), then start upping the pace.
-Once the race is over, stick around for the awards. It's pretty entertaining and the offroad crowd is a great group to hang out with. Most races usually give out prizes randomly so you may even get some swag!
That's about it. The most important aspect of racing is to make sure you HAVE FUN. That's why we do this in the first place. If you take it too seriously, you're going to end up hating racing. At least that's my opinion.
Oh yeah, one last thing. Eat a good dinner the night before, a good breakfast and a banana before your race. Keep hydrated too (I strongly suggest you don't party hard the night before a race).