When a link is shared, most apps show the page's og:image: a picture set with a meta tag in the page's head. 1200 × 630 pixels is the common size, about 1.91:1. X shows large cards closer to 2:1, so a sliver comes off the top and bottom; keep important text away from the edges and turn on View › Safe area guide to see the margin.
GitHub uses 1280 × 640 for a repository's social preview (Settings › Social preview), and YouTube thumbnails are 1280 × 720, where the video length covers the bottom-right corner. Share › Copy meta tags gives the tags to paste into your page. Settings and text live in the link, so Share › Copy link hands someone the same card.