A typical adventure has the following simple workflow:

Adventure→Sell Loot→Buy Stuff

In the Pathfinder Second Edition (PF2e) Remaster Rules As Written (RAW), there this is largely left up to the Game Master (GM) to adjudicate without any clear specifics on the buying and selling downtime activities.
For this campaign, I have a system that defines how items are sold and purchased in a settlement that remain consistent with the PF2e Remaster game system.

Selling Loot

We can refine the typical workflow a bit for selling loot:

Identification→Appraisal→Shares→Claims→Sales

The appraisal phase will not take up any appreciable downtime. Most of the downtime will be in the final step where the party wants to sell their loot.
To simplify things the GM determines how many days the Sales step takes and factors that in to the downtime the party needs to spend in a settlement.
Market forces in the region may affect the sale price and alter the share value. As a result, the sales step might affect the appraisal positively or negatively as determined by the GM and force shares to be adjusted accordingly. Such factors include things like trying to sell an item above the settlement level, selling items that are in high or low demand, selling illegal or black-market items, etc.

shopping

Instead of checking every single day, downtime for this task is handled in blocks of 3 to 7 days (a standard "shopping week" or "brokerage phase"). A standard 3-day search yields a small pool of items (immediate stock). If players commit a full week (7 days) of active searching, networking, and leveraging local contacts, the tool generates a larger pool of items. This represents deeper broker connections and specialty imports.
Here are some important things to note about shopping for items:

Pool Level=min(Average Party Level,Settlement Level)

Sourcing Existing Stock

Use these guidelines when a PC wishes to try and buy something they know exists somewhere in the settlement/region, but it doesn't come up from a standard or more thorough shopping search.

Commissioning an Artisan

This is in the event an item cannot be found pre-made and the PC wants to hire a local specialist smith, alchemist, or enchanter to build an item from scratch or modify an existing item.

High-End Acquisition

This covers the situation where the party needs a high-level item that is above the local settlement's level.

Buying Spells

The rules for buying spells is a bit of a mix between sourcing existing stock and commissioning an artisan, depending on the approach the PC wishes to take. Check with the GM for the availability of an uncommon spell. Rare spells will normally not be available for purchase.
If a PC is looking for the spell by sourcing existing stock it means they are looking for a written version of the spell in the settlement. This will always be in the form of a scroll, so success means they are able to purchase the desired scroll and can then attempt to Learn a Spell as normal.
If they wish to commission an artisan they have a choice: pay for them to help them Learn a Spell, or scribe a scroll for them so they can use that to learn from. If they choose the former, the artisan will charge them for the work under the Earn Income rules - using the amount from the Income Earned table based on the level and skill required (they still have to pay the normal costs to Learn a Spell). If the artisan makes them a scroll they pay the cost for the work to produce the scroll and the normal costs when they try to Learn a Spell.
When a PC looks for a teacher, they can chain rolls for the list of spells they are after. Cumulative successes represent a single 3-day search, reflecting a situation where the trainer can help with multiple spells.
Note: In the Pathfinder Second Edition Remaster version a scroll is not consumed when using it to Learn a Spell.