It depends on the park. Some of them have accommodation within, others just outside or in nearby towns.
Let's take Joshua Tree National Park as an example, since you're looking at going there.
You can fly in or take the train into Palm Springs, nearby, or drive. There are specific entrances to the park, where you usually pay a fee for conservation and the like. The north entrances to the park are located at Joshua Tree Village and the city of Twentynine Palms. The south entrance is at Cottonwood Spring.
Then it will, as I mentioned, cost you to get in. This is done in a variety of ways - The Joshua Tree National Park Annual Pass, $30 for 12 months; vehicle entry, $15.00 for 7 days; walk-in entry, $5.00 for 7 days.
Now, getting around the park. As you mention, some are big. However, many people will park a car near the gate and walk in, as it is cheaper and perhaps the part they want to see is close to the gate. For example, Yosemite - the first night I was there, we wanted to see the giant trees just inside the entrance, and it was walking distance from the west gate we entered at.
You can drive around Joshua Tree - as indicated by the vehicle entry charge. There are main roads, as well as several dirt roads. There are also many hiking trails - you'll want to make sure to take lots of supplies. Finally, you can mountain bike around the park as well - check at the entrance for maps and details.
Usually most parks will have highlights that you want to see (eg the Half Dome at Yosemite, or Yosemite Valley). They'll be on maps, and you might drive to a point, and then walk a trail for a while, say, to get to a particular viewpoint or waterfall or similar.
Incidentally, at Joshua Tree, there are campsites within the park, if you wished to do so. If you want to stay in a hotel, you'll have to stay outside the park.
Much of this information I gleaned from the Wikivoyage page on the park, which I recommend checking out if you're planning on going some time soon.
Another fine source of information is the National Parks Service web site. for example, their [page on Cabrillo] lists information on the park, the history, hours, fees, upcoming events, and directions. They have information on all the national parks in the USA.