Welcome to this hobby, couple months ago I faced a similar issue. My FH stress out and refused to eat pellet, then I tried to give him frozen bloodworm that creates another issue - ick. I came to this forum and people start giving me advice and suggestions.
My biggest mistake was I put FH to 10-gallon tank and it did not adjust well. So I get a 45-gallon tank, increase the temp to 81-83 F degrees and start to starve him for couple days.
after a week, he starts doing well and eats his pellet. I will give him varieties pellets and food, just to make sure my FH is not picky just any kinds of pellets or foods in case I ran out.