Extracting a substring from original string
Let's dissect your program a moment and see why it's not doing what you want:

while (Serial.available() &gt; 0)
{


So while there are characters available to read in the serial buffer

  rfid = Serial.read();


read one character into the rfid variable.

  String cardnum(rfid);


Convert that character into a string.

  cardnum.replace("", "");


Replace nothing ("") with nothing ("")

  cardnum.replace("", "");


Do the same again,

  String id = cardnum.substring(0,2);


Take the first two characters of the string that contains the single character that you have read.

  Serial.print(id);


Print it.

So basically you have read one character, made it into a string, done nothing to it, copied it to another string, then printed it.

Instead of this method, which does nothing useful, you should read the whole ID into a string (I'd use a C string [i.e., char array] rather than an Arduino String object) then perform operations on that string once you have read the whole ID code.

There's many methods of doing that, but how you do it is heavily influenced by exactly how the data is presented to you. Does it have a terminating CR or LF to indicate the end of the string? If not you will have to use some form of timeout to determine when the string has been completer.