If you are camping overnight and carrying food or smelly things (like deodorant) then you are required to have a bear can. I've never had a bear go after my food, but plenty of mice, chipmunks, and marmots have tried.

Once, I inadvertently left a tiny bag of salty peanuts in my backpack side pocket. At least two mice tore through the pocket and ate all the peanuts. How do I know? The next morning my collapsible 1 gallon water bucket had two mice in it (frozen solid). They must have been thirsty and gone for the water. Having fallen into water in the bucket they couldn't get out. The water froze solid overnight (not what I was expecting). This was in August of 2009. I hadn't anticipated temps dropping below freezing that night. Lessons learned. 1) don't leave snacks in your side pockets. 2) don't assume it won't get that cold at night. 3) in a survival situation, find a bucket or pot, fill it partially with water, leave a trail of food (like seeds from pine cones) for rodents to follow and fall in the bucket. If your lucky you might have a squirrel or a mouse in the bucket for breakfast. I actually felt bad for the mice and have been much more careful ever since that happened.

In the past, you could rent a bear can from the lone pine ranger / visitor center where you pickup your permits. During part of covid years this was not possible. Also, I believe Elevation Sierra Adventure in lone pine has rented out cans in the past. I'm not sure they currently do this. If you backpack more than a few times its better to buy one. I use the bearikade scout for trips less than a week (I don't eat much on trail for 1st 9 days yet always pack way more food than I ever eat). It's made of carbon fiber and aluminum, but is pricey. The plastic ones are heavier, but do the job nicely. One of my buddy's has the clear blue kind. That's really helpful. You can easily see what you are looking fore before opening the can. Most REI stores stock the black opaque and/or clear blue plastic bear cans (shipping is free for orders above a certain amount and I usually get it my order in less than a week). Bearikade you have to order directly from their site. Outside of bear country I have used a wire mesh bag that is very light weight and has totally frustrated foxes and mice. I do now put in a zip lock plastic liner because I camp regularly in areas that have had hanta virus outbreaks plus a few areas that have had plague outbreaks also stops ants in the short term. The wire mesh keeps critters out and the plastic liner prevents saliva and flees (from the animals) from contaminating food.

Use a can, relax, and enjoy the adventure. It will be awesome.