I mean, if you want the best answer,
Take a basic probability and statistics class.
That’s how you figure these things out, with basic probability and statistics. These are taught in most high schools and pretty much all colleges (barring extremely specialized schools, maybe), plus there are a plethora of online courses out there.
For the very most basic things, a single (fair) die has what’s called a “uniform distribution.” That is, when you roll a d6, you have an even (“uniform”) chance of getting 1, 2, 3, 4, 5, or 6. In probability and statistics, we talk about the “expected value” of distributions, which is what you can expect, on average, from that distribution. For a uniform distribution, the expected value is just the average (arithmetic mean) of each possibility in it. For a d6, that’s
$$ \frac{1 + 2 + 3 + 4 + 5 + 6}{6} = 3.5 $$
In a probability and statistics class, you’d learn about the expected value for all sorts of things. You’d also learn shortcuts for calculting them. In the case of a regular dX die (numbered 1 through X), the expected value is (X+1)/2, or (equivalently) X/2+½. And so for the standard dice:
Die |
Expected Value |
d2 |
1½ |
d3 |
2 |
d4 |
2½ |
d6 |
3½ |
d8 |
4½ |
d10 |
5½ |
d12 |
6½ |
d20 |
10½ |
For multiple dice that are added together (e.g. 4d6), you can determine the expected value by just multiplying the expected value by the number of dice (e.g. 4×3½ = 14). This still works when you use dice of different sizes (e.g. 4d6 + 3d4 = 4×3½ + 3×2½ = 21½). Flat numbers have an expected value of themselves, so you can just add those in (so 4d6+3 has an expected value of 14 + 3 = 17).
And that basically covers simple rolls of dice where you just add everything together. Note that there is a lot more to be said here. For instance, while you can just add expected values together to get the expected value from adding dice together, the sum of several dice does not produce a uniform distribution and 3d6 produces very different results from 1d20 even though they are both expected to average out to 10½ over the long run.
As for minimums and maximums, that’s going to depend a lot on how exactly you’re defining those. But if, say, you apply those to individual dice, so for example “d6, minimum 2,” and you’re just rerolling numbers below the minimum or above the maximum, you’re looking at a set of 2, 3, 4, 5, 6. So you can just do (2 + 3 + 4 + 5 + 6)/5, which equals 4. As long as your minimums and maximums maintain that uniform distribution (each number appears no more than once), all of the above will hold true, you just need to figure out the expected values of individual dice.
On the other hand, if you apply the minimums and maximums to the sums of multiple dice, so something like “3d6, minimum 8,” then you’re not dealing with a simple uniform distribution anymore, and that gets more complicated to calculate. Not necessarily very complicated, but you need more than the above. Likewise, if instead of rerolling numbers below minimums or above maximums, you bump numbers up or down as needed, that will also change things (since, for example, “d6 minimum 2” would be twice as likely to have a result of 2 as any other number). For specific, more complex rolls, separate questions specifically about that roll can be a good way to learn, but to be able to do it yourself, again, I recommend finding a decent online course.