To keep up with rising prices, many consumers are leaning on their credit cards.Credit card balances rose year over year, reaching $841 billion in the first three months of 2022, according to data released Tuesday from the Federal Reserve Bank of New York.Although balances fell slightly from where they stood at the end of 2021 following the peak holiday shopping season, they are expected to keep going up from here, according to researchers at the New York Fed. “There’s a good chance that Americans’ total credit card balances will soon reach a new record high, marking a sharp reversal from the precipitous drop that occurred in 2020 and early 2021,” said Ted Rossman, a senior industry analyst at CreditCards.com.More from Personal Finance:More Americans cash-strapped as cost of living rises Why there’s a push to cancel student loans but not other debtAmericans say inflation may have a ‘big negative impact’An additional 229 million new credit card accounts were also opened in the first quarter, up from the previous quarter and higher than prepandemic levels.Many accounts were closed during the pandemic, so it’s not surprising to see more new accounts now, according to researchers at the New York Fed.However, the rise in borrowing, together with auto loans, student debt and mortgages, propelled total household debt to a record $15.84 trillion at the beginning of the year.After consumers paid off $83 billion in credit card debt during the pandemic, helped by government stimulus checks and fewer opportunities for discretionary purchases, credit card balances have steadily ticked back up amid higher prices for gas, groceries and housing, among other necessities.”A lot of this is being driven by robust consumer spending, of course, but credit and debit cards have both been aided by the growth of e-commerce and the ongoing migration away from cash,” Rossman said. “This is great if you can pay in full, avoid interest and earn rewards, but potentially very costly if you’re paying interest every month.”In fact, credit card rates will only head higher as the Federal Reserve hikes interest rates as it looks to tamp down inflation, which is running at its fastest pace in more than 40 years.Since most credit cards have a variable annual percentage rate, there’s a direct connection to the Fed’s benchmark.APRs are currently just over 16%, on average, but may be well over 18% by the end of the year — which would be an all-time record, according to Rossman.To date, the record is 17.87%, set in April 2019. “With rampant inflation and rising interest rates, things are going to get worse before they get better,” said Matt Schulz, chief credit analyst for LendingTree.If you’re carrying a balance, try calling your card issuer to ask for a lower rate, consolidate and pay off high-interest credit cards with a lower interest home equity loan or personal loan or switch to an interest-free balance transfer credit card, he advised.”Consumers need to act now to knock down that credit card debt because it is only going to get more expensive — and in a hurry,” Schulz said.To build better credit card habits, make sure to pay off your balance on time and in full every month and only make purchases you can afford to pay back, noted Holly O’Neill, president of retail banking at Bank of America.”Spending within your means will leave more money at the end of every month and help reduce your debt,” she said. “As an added bonus, spending less than your limit allows will also help you build a stronger credit score.”(Here’s why your credit score matters and five ways to improve it.)Subscribe to CNBC on YouTube.