I wouldn’t attempt to dry wet grounds - the quality would likely suffer and for brewing they will be made wet again, which would make the drying step moot. Just use them straight from the fridge (as discussed in your other Q/As) and proceed as usual.
Now, beans are different. All preparations I am familiar with require the beans to be ground in one way or other. Pouring wet items in a grinder or mill designed for dry food will cause clumping, clogging and at worst damage your grinder.
Successful drying requires two things:
- An environment with a low relative humidity and
- good air flow around the objects that are to be dried.
So arrange your beans in a single layer on a rack or tray and find a “dry and windy” spot. The temperature can be even cool room temperature (dry surroundings and airflow are crucial, not temperatures), but may cooks prefer a low oven with the door slightly ajar. Up to 50 C won’t be a problem for the beans. Drying time depends on how wet the beans were - check on them regularly and turn them around on the tray.