I worked at a local True Value in the early 90's in a small town (10,000 people) that has survived Wal Mart and on line retail and still doing well. Hey actually grew the business into the old Wal-Mart building when they built a bigger store. I know two guys that own Ace stores. One in Minnesota and one in a Houston ex-burb. The key to these business is -- obviously -- not compete with the box stores.
To do so, your REALLy need to know the local market; the very local vicinity of customers that won't drive to the box store for the little stuff or need some help with what they need to buy that they need help with. For example, if your store is in an area with homes over 20 years old, a deep stock of plumbing repair parts for faucets of that era. If you've got a working neighborhood with DIYers; then have a very deep stock of builders hardware, open stock hardware and fix it parts. If you've got a higher end neighborhood, maybe it's high end grilling supplies, garden statuary, and unique gift items. Lots of bikers and car guys, then have a good section of chrome hardware and automotive hardware.
If there isn't a paint store around (i.e. Sherwin Williams) then have a deep stock of non-Minwax brands, finishes, and better quality paints than box store DIY brands. Mixing custom paint colors is the way paint works today. So market the heck out if, have it up front and staff it well. Consider how long the wait is at the box stores on a Saturday morning to buy paint and and beat them at it.
The Ace's around here are Sthil dealers, Big Green Egg dealers. They rent carpet cleaners. In general, the rental business is good if you have the right stuff for the area and market it.
Make custom picture frames, do screen repair and offer a sharpening service if there isn't anything in the immediate area. The guy I worked for had a full time position on vacuum cleaner repair and took used vacs on trade, fixed them and sold them. He also had a part time position on screen repair and glass repair. Small engine repair can differentiate your $300 lawn mower from the box box lawn mower for $300.
One of the ACE's around here is semi-rural. They have a lot of pet supplies, tack and things for people that keep a few chickens. My kid browses this section for dog stuff while I'm shopping, which creates add on sales for them. And gate supplies (acreages have gates).
Learn how to manage your inventory and get rid of stock that isn't selling even if you have to discount it. Especially big ticket or big shelf space items. Learn how to merchandise. ACE will offer fixture planners that will give you the shelf layout or peg board layout for how to sell stuff. You don't need to buy these. But you do need to now how to put the impulse items and fast sellers where people will buy them. Make them walk to the things they absolutely need. The guy I know in Minnesota has his sporting goods, RV and boat supplies on the second level. It's absolutely backwards because the causal browser or occasional shopper that stops in looking for supplies doesn't see this stuff. Stuff like that needs to be front and center.