Recognize that the valley floor will be crowded all summer long. If you are intent on visiting the valley in the summer it is essential to make your reservations for camp grounds or lodgings as early as possible. Arrive as early as you can in the day. There are campsites and hotels that ring the park that can accommodate you if you have a long way to travel.
A better summer solution is to understand that the valley floor is just a small percentage of the of the park's 1200 square miles. I've spent many a pleasant week backpacking in solitude through Yosemite's backcountry. You will need a permit for each night that you camp off the well worn path. It's not only a matter of safety it's a way to limit human impact to the wilderness.
If you are backpacking be sure to bring any food you need with you. It's wonderful to have romantic notions of catching a trout from a clear mountain stream and pan frying it over a wood fire, but it probably won't happen. None of the lakes in a national park are stocked. With millions of visitor a year, the trout are no longer plentiful. Since you've packed in your food, you'll have to protect it at night. Some of the campsites have bear boxes. Most do not. Years ago, it was okay to toss your food over a branch and haul it up a tree, but bears have become more sophisticated of late realizing that by pulling on any ropes in the woods a gift of food will fall from above. After employing that strategy once, I was left without anything to eat and a shredded food sack four days out on a backpack out of Hetch Hetchy. Talk to the rangers about the new recommended bear protection methods. They involve throwing a sack with a counterweight over a high branch then fishing for it with a pole when you plan to leave. Another is to pack in a bear canister.
If backpacking is too physically demanding for you, Yosemite offers a ring of five Hgh Sierra Camps accessible only by foot or saddle spaced 6-10 miles apart along a loop trail in the wilderness. The camps provide food and lodging family style, so you don't have to pack in either food or a tent. Making the High Sierra Camp Loop, you can get by with a day pack. If you don't want to walk, take one of many pack and saddle trips through the backcountry that will get you away from the crowds on horseback with a professional guide. Again, given their popularity, make reservations early.
Be sure to carry a filter for your water. Years ago you could drink directly from Yosemite's streams, but today thanks to human waste, Giardia, a parasite, is common. This protozoa causes a nasty form of diarrhea. I prefer using a bottle with a filter on the top rather than a pump so I can fill up and drink faster.
By far the best time to see Yosemite Valley is in the off season. One Easter Sunday I climbed the falls and was greeted with the biggest flow down that cascade I had ever seen. At Christmas the Ahwahnee Hotel on the Valley floor is a magical place, usually shrouded in snow. Blissful solitude waits mere footsteps from the door. If you want to go on this holiday, again, make reservations early.