It`s difficult to take these phrases out of context and see how they are used, but this is the best that comes to mind. „If ever“ is a term that tends to pop up at the end of a sentence, preceded by a comma, and is frequently contrasted with words preceding it meaning rarely. Like the above example, „He rarely gets out of bed, if ever.“ The „if ever“ adds the possibility that something mentioned never happens at all, when paired with rarely. „Rarely is that done, if ever.“ Something here is done only on rare occasions, or never. „Doctors rarely treat this disease with surgery, if ever.“ Doctors only on rare occasions use surgery to treat a particular ailment, but ordinarily never do. „If ever“ tends to be contrasted with „ rarely“ relatively frequently. So, look for these kinds of word pairings.
„If anything“ is paired with expressions involving the minimal quantity of something, or perhaps its non-existence. It always helps to see the expression in a context to understand it. As an example, I could say „that guy has probably only got a couple of dollars in his pocket, if anything.“ See how „if anything“ is paired with a description of something meaning „very little“ or „not much“? „That person is so poor, I`d bet he has very little money in his bank account, if anything.“ Another example which illustrates how the phrase is used with „if anything“. Think of a preceding description of somebody not having much of quantity or value, then to toss in the idea that this minimal quantity or value could be zero, use „if anything“ to suggest this. This phrase normally comes at the end of a sentence, and is preceded by a comma.