What should I do to prepare my home for sale?
The Pre-inspection
The first thing you should consider is the fact that any potential buyer is more than likely going to want a home inspection. Any major warts that your home may have, they're going to find. That's why I will go ahead and recommend getting the inspection yourself prior to listing.
For one, if there are any major issues that are going to be potential dealbreakers for potential buyers, and you don't currently have the money to get them repaired, it's best to know that upfront instead of after getting your home under contract.
If and when repairs are completed, we can attach receipts to the listing and note that it was recently serviced/repaired/replaced.
For another, a pre-inspection gives buyers the confidence to make an offer, or to offer a higher price, knowing that the home is "move-in ready".
Staging
Every home should be staged when listed for sale. "Staged" can mean different things, depending on your situation.
If the home will be vacant, it involves bringing in furniture to help the property feel more like a warm home and less like an empty cold warehouse, and to help the buyers envision themselves in the new home. Although this can be expensive.
A less expensive alternative is "virtual staging" whereby furniture is virtually added to the photos of your home and in your listing. This can be effective at getting potential buyers into the home, but obviously won't do much for them once they're standing inside of it.

If the home will be occupied, it involves moving all of your "stuff" into the garage (being careful not to block access to the attic or the breaker box) and hiring a professional stager who will help you to arrange your items and de-clutter and de-personalize in a helpful way.
Upgrades
Consider your home from a holistic view: If your home was built in 1992 and has musty carpets and popcorn ceilings and you install marble countertops, this will not be a sound financial decision. The value will not increase above what it cost to install, if at all. If your home is almost entirely renovated but the master bathroom was last on your list, it's probably a good idea to invest in updating that to match the rest of the home.
Most often, any updates do not increase the home's value. Sometimes you can get discounted hardware prices and DIY it but then you have to consider what is the value of your time.
If you have an older home and want to renovate the entire thing, that may also be a good option.
But before doing any of these things you need to consider the comps. If other homes in your neighborhood have a specific feature that yours lacks, it might be a good idea to install it, and vise versa.
Flooring
Any dirty carpets need to be, at minimum, shampooed, but more likely, replaced. If you have hardwood floors, replace planks with deep scratches.
Many homes have several different types of flooring. Consider potentially narrowing or even unifying the different types and making sure they're in the proper locations. Carpet is okay in the living room and bedrooms (though not ideal) but absolutely have no place in the kitchen or bathrooms.
Make sure you choose neutral colors. Remember what you like and what any potential buyer may like are not necessarily the same thing. The goal is actually to de-personalize the home and to cater to the largest pool of buyers, and not any particular individuals.
Paint
Same as above. Walls should be cleaned. If paint is not in good shape, it needs to be redone. This can be very expensive to hire someone to do but is very inexpensive and straightforward to DIY.
If you have lots of rooms with different colors, I highly recommend, at a minimum, unifying these colors as one. Ideally the one color should also be a neutral tone, just like the carpet. Most likely some shade of bright white, as the paint has a dramatic affect on how light fills a room.
Curb Appeal
Make sure your lawn is cut, and if necessary, acquire professional services to ensure it remains that way every few weeks while it is still listed for sale.
Before taking photos, throw down a fresh layer of mulch and some bright flowers in any flower beds or pots.
HVAC
Ensure your heat/cold is set to a comfortable temperature. Yes, it will cost you money, but in addition to removing doubts from potential buyers about it's efficacy, it also prevents mold buildup when it's hot and frozen pipes when it's cold. And while we're on that topic:
Thermostat
Consider installing a smart thermostat with a nice display that lights up as you walk by. This will catch the eye of property tourers and they'll make a mental note as one less thing they need to do after moving in.
Light Fixtures

Light fixtures are generally going to be low-cost high-impact items. They can easily be purchased for ~$100 from brands like Artika from Costco, replaced in less than an hour, and go a long way toward creating a modern and updated feel in the interior.
Switches and outlets
Another low-cost high-impact item is replacing light switches and electrical outlets with some more modern ones. These cost ~$10-20 and can be installed in ~15 minutes/item. You might consider making upgrades where appropriate, such as USB charging outlets in kitchens and bedrooms and dimmer switches in living and dining rooms.
While upgrading GFCI outlets consider picking up the ones with a beeper or a night light.

If you have bathroom fans, consider picking up a switch with a humidity sensor or a timer.


Consider potentially adding motion switches in the kitchen and any hallways. You just have to apply some careful thought and consider use-case and orientation to determine where they're appropriate.

They also sell nightlight switches and outlets:
Do pay attention to pricing, as it can go up quickly with these upgrades, but should be fairly inexpensive quality-of-life upgrades.
The screwless wallplates, in my opinion, go a very long way to making a home look more modern. These can be sold by a variety of different brands but do be aware that these need to be fire-rated.

Bonus, these same rocker-switch wallplates also fit over the modern-style electrical outlets.

Ceiling Fans
Yet another low-cost high-impact item will be ceiling fans. These typically also have lights built into them so you can get a 2-for-1 deal. Often these cost $80-150. I would recommend ensuring every bedroom has one, as well as the main living area.

If you have a ceiling light and no fan, you can't just drop the fan in, as it is heavier and needs support, but there are some simple supports you can buy and easily install these as well.

Advertise!
Any upgrades made should be put in a written list and attached to your listing, and probably left somewhere very obvious on the interior of the home.
No point in doing upgrades if no one knows about them!