Say your 2019 income is $20,000. If you max your 401k contribution at $19,000, are you limited to putting only $1,000 in a traditional or Roth IRA, or can you still contribute the max $6,000?
Or in another example: Say you have a Roth IRA and a SEP IRA, and your 2019 compensation is only $5,000. You put the $5,000 in your Roth IRA. Can you now put $0 in the SEP IRA, or can you still put $1,250 (25% of compensation) in the SEP IRA?
Assuming no other sources of compensation and the 401(k) plan is with an employer who provides you with a W-2, your IRA contribution will be limited by the amount reported in box 1 of your W-2. If you earn $20,000 and make traditional 401(k) elective deferrals of $19,000, only $1,000 would be present in box 1 of your W-2. However, if you can make a sufficient amount of Roth 401(k) contributions instead of traditional 401(k) elective deferrals, Roth 401(k) contributions are not excluded from box 1 of your W-2 and your permissible IRA contribution would be higher, perhaps with the combined amounts exceeding your $20,000 of earnings.
Regarding your second example, you can only make SEP-IRA contributions if it is from earnings from self-employment; SEP-IRA contributions are employer contributions. The self employed must use a special calculation to determine the maximum amount that can be contributed to the SEP-IRA, so with $5000 of self-employment net profit your maximum SEP-IRA contribution would be 20% of the result of reducing $5,000 by the deductible amount of self-employment taxes. In this case the deductible portion of self-employment taxes would be $354 and the maximum SEP-IRA contribution would be $929. Subtracting these to amount from $5,000 would leave a maximum permissible IRA contribution of $3,717.