I have put in a 200 amp panel in the shed and will run a mini-split A/C unit (25 amp draw), a computer, and a few LED lights. What size wire do I need to run from the house main panel to the shed. I was thinking either #4 or #2 in a non-metallic conduit buried 24 inched deep. Will this pass code inspection.
Any panel has a bus rating (the redline maximum). Some panels also have a main breaker. So yours is 200A. That has no bearing on the wire size.
The subpanel has feeder wires coming into it. These are sourced from a supply breaker in another panel, let's say the main panel.
You can use any size feeder wire that is appropriate to the actual loads in the box.
The supply breaker must be appropriately sized to protect the feeder wire.
#4 aluminum feeder is 65A (per Table 310.15(B)(16), 75C column). 65A breakers are not made, so you can use a 70A breaker (or a 60A, as they are cheaper).
#2 aluminum feeder is 90A (ditto).
#4 copper feeder is dumb to use, since subpanels use aluminum heavy feeder very happily. #4Cu cable that is NM or UF type is 70A. All other #4Cu is 85A. 85A breakers are not made, so 90A breaker.
You cannot plan to use the breaker trip amps. Suppose the calculated load in the subpanel is 86 amps. The feeder must be able to carry the calculated load. So #2Al (90A) is fine, but #4Cu (85A) is not fine.
You question asked "need", that implies asking what the minimum size needed. The NEC doesn't specify a minimum size feeder for a panel, the rating of a panel is only the maximum allowed. Minimum feed is load dependent. The attached load is calculated then adequate wire for load is selected for load, then breaker in the source panel sized to not exceed wire or panel rating.
Calculating 25A or less minimum circuit ampacity for a 240v A/C, and two 15A 120v circuits on opposite panel legs, one for computer and one for lights then you could get by with a 40A feed from the source panel.
Assuming you have breakers with 75°C terminations then #8 aluminum protected a 40A breaker in 3/4" sch40 pvc would be adequate for the load you described. That solution is minimalist and short sighted, I likely wouldn't even bid it.
Beyond that it becomes a question of cost and ease of material installation. Two possible scenarios are using the same easy to work with 3/4" pvc you could do up to a 70A feed from your source panel with #6 copper circuit conductors with #8 ground, or for about the same price using larger 1.25" pvc use up to a 90A feed using #2 aluminum conductors with #4 ground mobile home feeder. You could go beyond that or anywhere between depending on your own preference and future provisions. Those numbers are assuming using individual wires, not a cable because cables require much larger conduit and typically have lower rating.
24" cover over pipe is good, your actual requirement may be less depending on a few factors, search Table 300.5 to identify your conditions. Notice the table shows "cover" requirement, the conduit must be below that depth.
Also wires have specific color requirements that vary with size, generally wires smaller than #4 need insulation colored for use, #4 and larger can be marked with tape. Ground rod(s) will be required at the shed.