A lesson I learned is to go back to the start, it’s easier to set a derailleur up from scratch than it is to faff about.
check the wheel is sat properly in the frame, check chain length if it’s new, it might be too long.
Has it been bashed, is the mech and hanger straight? Remove the chain and and losen the cable where it’s bolted to the mech. move the mech with your hand and see if it moves properly over the cassette and springs back when you let go.
If all is OK, put the chain back on.
After that, put the shifter into the smallest cog position, make sure any barrel adjusters have a good turn or two in either direction.
then tighten the cable up, it should have no slack in it but shouldn’t be tense.
Then set your limit screws.