How many of each pill to take to achieve the total daily dose
R, 53 38 bytes

function(x)c(x%/%5,2*x%%1,(x&lt;20)*x%%5)

Try it online!
Output is in the order (5mg, 2.5mg, 1mg).
For the 2.5mg pills:

if the dose is an integer, we need 0 such pills. Indeed, 1 pill of 2.5 mg would not give an integer, and 2 pills of 2.5 mg can be replaced by a single 5mg pill
if the dose x is not an integer, we need exactly 1 such pill (similar argument), and then we call the function with the integer x-2.5.

The number of 5 mg pills is the integer division of the input by 5.
Note that because the input is restricted, the 1 mg pills are never needed when the input is ≥20. If the input is &lt;20, the number of 1mg pills is given by taking the input modulo 5.