Welcome!
Each area does their harescrambles a little bit differently-- the races I've been in rarely use MX tracks, and the women's class runs at the same time with all the other big bikes (if there is a separate women's class).
Find an event in your area or district, or call a local club. Go and attend one of the events as a spectator, and ask some questions. Probably one of your best bets is to go ask questions of people working the sign up table, (AFTER all the racers have signed up!). They can tell you about what classes are available, how long the course is (time/mileage), and what signup fees and requirements are (district card, AMA card, etc.)
Walk around, look at the terrain, and you'll get a general idea of how things work. If you have a friend who races, offer to go with them to a race and help them with their pit stop-- carry a gas can or extra water or goggles or whatever they need done.
In essence, though, a harescrambles is a race held on a closed course loop, of predetermined length, for a predetermined amount of time. (Depending on club and district). The rider who completes the most number of laps in the given time is the winner. The course can cover all types of open or tight terrain, from woods, fields, creeks, hills, desert or whatever else the club can come up with. To prepare, you should try to ride as many different areas as you can to familiarize yourself with all the terrain options. Also, building up your endurance to ride for 2-3 hours without stopping is good as well. If you can avoid stopping during the race, you'll be just that much ahead at the end.