i'Ve spent a fair amount of time in Yosemite. Your behaviors will depend on where you are in the park. If you're near your car, leave valuables (hidden and locked) in the car. If you are close enough to your car to do this, it will likely be crowded where you are. If you are in the back-country, set up your camp, take whatever you CAN'T lose with you, and head out. Use good camping manners. The valley is crowded, and we all need to reduce our impact. Minimize items that would make bears want to be in your camp, use good camp hygiene. If you are going to do one of th eimmensly popular trails, remember, even though you will be likely surrounded by people, you are in the wilnderness, and are responsible for yourslef. Have enogh water, food, the right shoes and clothing,knowledge of the area, etc. If you are at elevation (half dome, any of the domes, cloud's rest, glacier point) and see weather that you don't like or hear thunder, it's time to move on without delay. Storms can happen very quickly, and all of those areas get hit by lightening often.
If you are setting up in the valley and then hiking out, go ahead and set up camp and then do your hike. Remember to take anything you might need, even on a day hike (don't forget the ten essentials, and forgive me if you are already an experienced hiker, just new to yosemite).
There are some AMAZING less known trails that will get you out of the crowds. My wife and I were there over memorial Day weekend a few years ago, and hiked one trail that went about 4 miles, with amazing views of Yosemite Falls, and eventually El Capitan, ending at a very popular tourist desitnation, but until we gotr to this popular spot, we didn't see a single person. This same weeeknd, there were so many people on the mist trail (half of them in jeans or sneakers, with one bottle of water for a family, saying they were "gonna head on over to half dome".... ugh....) that the bottle neck behind them nearly had us turn around.
Enjoy. Yosemtie is a beautiful place, and a truly inspiring location to spend some time inthe glory of nature.