The decision on where to spend the nights at Yosemite depends on your preference, budget, and your planning skills. You can find very inexpensive tent cabins or you can go all the way and stay at the luxurious Ahwahnee Hotel (Majestic Yosemite Hotel). You can rough it at a campground or go on a backpacking trip through the wilderness.
Whatever you decide to do, you will need to plan way ahead. All hotels, lodges, and campsites are booked many months ahead of time. Some of the more popular ones are booked 12 months in advance.
Lodging
In my opinion, the best lodge for the value is Yosemite Lodge at the Fall (Yosemite Valley Lodge). It is located right on the valley floor next to Yosemite Fall. It is a large complex with about 240 rooms, a swimming pool, a food court, a restaurant, shops, bicycle rentals, and many other amenities. Rooms will run you around $200 per night depending on the season.
The main drawback is that there is no air conditioning in the rooms and if you want WiFi for your gadgets you will need to go to the main lobby.